
Template details
eve Memory Agent
eve agent template with long-term, per-user memory powered by Mem0, deployable to Vercel through the Marketplace integration.
About this template
Mem0 eve template is a Vercel eve agent starter that gives a backend AI agent long-term, per-user memory through Mem0, so it recalls facts and preferences across separate conversations instead of starting from scratch each session.
What is the Mem0 eve template?
The Mem0 eve template is an agent template built on eve, Vercel's framework for durable backend AI agents, with long-term memory supplied by Mem0. Its input is a chat session and its output is a model response that is informed by previously stored facts about that user. Memory is written and retrieved through two tool calls, and the whole thing deploys to Vercel, where the Mem0 integration sets the MEM0_API_KEY environment variable on the project automatically. Model access runs through the Vercel AI Gateway tied to your linked project. The repository is published under the Apache-2.0 license.
What makes it stand out?
- Two Mem0-backed agent tools —
remembersaves a durable fact or preference viamem0.add, andrecall_memoriessearches long-term memory viamem0.search. - Per-user memory scoping — memory partitions by
ctx.session.auth.current.principalIdinagent/lib/mem0.ts, so each authenticated user gets a separate memory store without extra configuration. - Instruction-level recall policy —
agent/instructions.mdtells the model to recall memories before answering and to store durable facts it learns. - One-click Vercel deploy — the Deploy button clones the repository and installs the Mem0 integration, which provisions
MEM0_API_KEYon the new project. - Placeholder auth by default —
agent/channels/eve.tsships withplaceholderAuth(): local development works, your own Vercel deployments and the eve TUI can reach the agent, and anonymous browser traffic is blocked in production. - Swappable auth providers — add Auth.js, Clerk, or
vercelOidc()to open the agent to real users, or swap innone()for a throwaway public demo where everyone shares one memory. - Vercel AI Gateway for models — no separate provider key is required beyond linking a Vercel project.
- Local REPL development —
npm run devopens the eve development REPL for testing the agent without deploying.
How does the Mem0 eve template work?
Deploying clones the repo and installs the Mem0 integration, which writes MEM0_API_KEY into the project; the agent then answers via models reached through the Vercel AI Gateway. During a conversation the model calls recall_memories before answering and calls remember to persist durable facts, both scoped to the authenticated principalId. Locally you run npm install, vercel env pull to fetch MEM0_API_KEY, set AI_GATEWAY_API_KEY (or link a Vercel project for model access), then npm run dev. A quick test: tell the agent you are vegetarian and allergic to nuts, start a new session, and ask what you can eat.
Who should use the Mem0 eve template?
- Vercel developers starting an agent project: a working eve agent with memory tools, instructions, and a channel already wired together.
- Teams adding personalization to a chat agent: they replace
placeholderAuth()with Auth.js, Clerk, orvercelOidc()and get per-user memory automatically. - Developers evaluating Mem0: the two tools show
mem0.addandmem0.searchin a real agent loop rather than a standalone snippet. - Demo and workshop builders: swapping in
none()gives a shared-memory public demo without auth setup.
Use cases
- Personal assistant agents: persist dietary, scheduling, or preference facts so the agent answers follow-up questions correctly in later sessions.
- Support and onboarding agents: remember a user's plan, setup state, or recurring issue and reference it on the next contact.
- Prototype evaluation: test whether recalling before answering improves responses, using the eve REPL locally before deploying.
- Marketplace deployment practice: walk through the Vercel integration flow that auto-provisions a third-party API key.
FAQ
Is the Mem0 eve template free?
The template source is open source under the Apache-2.0 license, so the code itself costs nothing. Running it requires a Mem0 API key, which the Vercel Marketplace integration provisions, and model access through the Vercel AI Gateway on a linked Vercel project.
How is memory kept separate between users?
Memory is scoped per user through ctx.session.auth.current.principalId, read in agent/lib/mem0.ts. Once you add a real auth provider such as Auth.js, Clerk, or vercelOidc(), every authenticated user automatically gets an isolated memory store.
Does it work locally without deploying?
Yes. The default placeholderAuth() allows local development, and npm run dev opens the eve development REPL. You still need to pull MEM0_API_KEY with vercel env pull and supply model access through AI_GATEWAY_API_KEY or a linked Vercel project.
What happens if I deploy it as a public demo?
With placeholderAuth() in place, anonymous browser traffic is blocked in production, so the agent is not publicly reachable. For a public demo where all visitors share a single memory store, replace placeholderAuth() with none() — note that everyone then shares the same remembered facts.










