A complete Elixir client for the Zep AI memory API.
Zep organizes agent memory around a few core resources, each with its own module here:
Zep.Thread(+Zep.Thread.Message) - conversation threads and the messages within themZep.User- the identities threads and graph memory attach toZep.Context- custom context-rendering templatesZep.Graph(+Zep.Graph.Edge,Zep.Graph.Episode,Zep.Graph.Node,Zep.Graph.CustomInstructions,Zep.Graph.Observations,Zep.Graph.ThreadSummaries) - the temporal knowledge graphZep.Project- project-level settingsZep.Task- async task/job statusZep.Batch- bulk ingestion jobs
Quick start
client = Zep.Client.new(api_key: "z_...")
{:ok, user} = Zep.User.add(client, "user-1", first_name: "Ada", last_name: "Lovelace")
{:ok, thread} = Zep.Thread.create(client, "thread-1", "user-1")
{:ok, _} =
Zep.Thread.add_messages(client, "thread-1", [
%{role: "user", content: "Hi, I'm Ada.", name: "Ada"}
])
{:ok, %{context: context}} = Zep.Thread.get_user_context(client, "thread-1")Every resource function returns {:ok, result} or {:error, %Zep.Error{}} /
{:error, %Zep.TransportError{}} - see Zep.Error for how to pattern-match
on specific failure reasons.
Configuration
A client can be built explicitly with Zep.Client.new/1, or every resource
function can be called with a plain keyword list instead of a client and
configuration will be resolved implicitly from Application env / the
ZEP_API_KEY environment variable - see Zep.Config for precedence rules.