Example showing how to search a user's knowledge graph.
This example assumes using Zep; is in scope and apiKey contains your Zep API key.
1 2 3 4 5 6 7 8 910111213141516171819202122
// Create a Zep client with your API key.usingvarclient=newZepClient(apiKey);// Add data to a user's knowledge graph.varuserId="test-user-"+Guid.NewGuid().ToString("N")[..8];awaitclient.SubpackageUser.AddAsync(userId:userId,firstName:"Graph",lastName:"User");awaitclient.SubpackageData.AddDataAsync(data:"Alice works at Acme Corp as a software engineer. She joined in 2023.",type:ModelsGraphDataType.Text,userId:userId,sourceDescription:"user_profile");// Search the user's knowledge graph for relevant facts.varresults=awaitclient.SubpackageSearch.GraphAsync(query:"Where does Alice work?",userId:userId,limit:5);