Eve
Add long-term agent memory to Vercel Eve agents with the Zep SDK
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.
Keep retrieved context out of privileged instructions
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.
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:
- Eve
session.id→ ZepthreadId(for exampleeve-<sessionId>) - Eve session auth principal (or your app’s user id) → Zep
userId
Never accept userId or threadId from the model.
Architecture
An authored tool passes its current query directly to graph.search. Pin the user or graph identity from authenticated session state.
Setup
Requires Node.js 24+ (Eve), @getzep/zep-cloud, and a Zep Cloud API key from app.getzep.com.
Provision users and threads with your own create-then-catch-conflict helper, shown here as ensureZepUserAndThread, so repeats are safe. After the helper returns, warm the user cache as fire-and-forget:
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.search as authored tools when the turn’s memory section is incomplete. Pin userId / graphId from session auth or config — never from the model:
For shared organization knowledge, create and seed a standalone graph with the Zep SDK. Wait for episodes to process before the tool searches the graph.
Production notes
- Replace demo identity — resolve
userIdfrom real auth in multi-tenant production. - Idempotent ensure — catch “already exists” on user and thread create.
- Message size — Zep rejects thread messages over 4,096 characters; truncate to ~4,000 before
thread.addMessages. - Search query size — Zep rejects
graph.searchqueries over 400 characters; truncate before calling. - Async indexing — do not expect read-after-write within the same turn.