Skip to content

MEAI Tools

Example showing how to use Zep as AIFunction tools with any IChatClient.

This example assumes using Zep; is in scope and apiKey contains your Zep API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
// Create a Zep client with your API key.
using var client = new ZepClient(apiKey);

// Create AIFunction tools for use with any IChatClient.
var addMemoryTool = client.AsAddMemoryTool();

var searchMemoryTool = client.AsSearchMemoryTool();

var getContextTool = client.AsGetContextTool();

var listThreadsTool = client.AsListThreadsTool();

var getUserNodeTool = client.AsGetUserNodeTool();

var addMessagesTool = client.AsAddMessagesTool();

// These tools can be passed to any IChatClient for function calling:
// var chatResponse = await chatClient.GetResponseAsync(
//     "What do you remember about Alice?",
//     new() { Tools = [searchMemoryTool, getContextTool] });