Eve
Eve is Vercel’s framework for building production agents. This guide shows how to wire Zep into an Eve agent with the Zep TypeScript SDK. The pattern uses hooks for persistence and authored tools for retrieval.
Zep context can include content that your users, documents, or tools supplied. A system or developer message gives that content higher instruction priority than ordinary input. Some convenience integrations use system-message injection. Use direct SDK retrieval or an actual retrieval tool call unless all stored content is application-authored and trusted. Follow Memory security best practices for provider-specific placement.
To build an agent that plans its retrieval and uses several Zep tools, read Build an Agent with Zep. The guide shows how to add domain knowledge, design tools, and evaluate the agent.
Why this pattern
Eve hooks are observe-only. They can persist side effects, but they cannot add model input. Authored tools preserve the distinction between application instructions and retrieved data.
Do not use Eve dynamic instructions or channel context for retrieved memory. Dynamic instructions enter a privileged channel. Channel context enters durable session history and accumulates.
Identity mapping stays outside the model. Zep generates the UUID of each user and each thread, and a create call accepts no identifier from your application. Keep the Zep UUIDs in your own storage, next to the Eve identifiers:
- Eve session auth principal (or your app’s user id) → the Zep
userUuidandgraphUuidthatuser.createreturned - Eve
session.id→ the ZepthreadUuidthatthread.createreturned
Never accept a user, thread, or graph identifier from the model.
Architecture
An authored tool passes its current query directly to graph.getContext. Pin the graph UUID from authenticated session state.
Setup
Requires Node.js 24+ (Eve), @getzep/zep-cloud on the preview dist-tag (the v4 SDK is a pre-release), and a Zep Cloud API key from app.getzep.com.
Provision the Zep user and thread one time with your own helper, shown here as ensureZepUserAndThread. The helper reads the Zep UUIDs that your application stored for the user and the Eve session. If a UUID is missing, the helper calls user.create or thread.create with no identifier and stores the UUID from the response. The stored UUIDs keep a repeated call from making a second resource. After the helper returns, warm the user graph as fire-and-forget:
One way to write the two helpers. ensureZepUserAndThread reads and fills the Zep UUID columns of your own records, and resolveZepIdentity reads the same columns on each hook call:
Automatic message capture
Persist each turn with a hook. Skip interim narration before tool calls (finishReason === "tool-calls"); persist other completions (stop, length, and similar):
Wrap each Zep call in try/catch so a Zep outage never fails the Eve turn.
Zep indexes knowledge asynchronously. Facts from a turn are not reliably searchable until processing finishes — often tens of seconds. Confirm facts in the Zep app before expecting preference recall in a new session.
On-demand search tools
Expose graph.getContext as authored tools. Pin the graph UUID from your own records or config — never from the model:
For shared organization knowledge, create and seed a Context Graph with the Zep SDK. Wait for episodes to process before the tool searches the graph. Store the UUID that graph.create returns in your configuration, for example in ZEP_COMPANY_GRAPH_UUID.
Production notes
- Replace demo identity — resolve
userIdfrom real auth in multi-tenant production. - Safe retries — a v4 create has no identifier, so a repeated create makes a second user or thread. Store the UUIDs after the first create. An idempotency key is optional.
- Message size — Zep rejects thread messages over 4,096 characters; truncate to ~4,000 before
thread.addMessages. - Search query size — The example truncates the
graph.getContextquery to 400 characters, because a long query increases latency. - Async indexing — do not expect read-after-write within the same turn.