---
title: "eve Mem0 Agent"
description: "Build an eve agent with Mem0 memory to save user facts and preferences, recall relevant context, and scope memory by user."
url: "https://vercel.com/templates/eve/eve-mem0-agent"
links:
  repository: "https://github.com/mem0ai/eve-mem0-template"
  demo: "https://eve-mem0-demo.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=eve+Mem0+Agent&demo-description=Build+an+eve+agent+with+Mem0+memory+to+save+user+facts+and+preferences%2C+recall+relevant+context%2C+and+scope+memory+by+user.&demo-url=https%3A%2F%2Feve-mem0-demo.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2FKeUXDiyoYXxDDGypBw7ri%2F23ae37dbfe8d2a3efb251fdba4b32bb9%2Feve-mem0-agent-3x.png&project-name=eve+Mem0+Agent&repository-name=eve-mem0-agent&repository-url=https%3A%2F%2Fgithub.com%2Fmem0ai%2Feve-mem0-template&from=templates&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22mem0%22%2C%22integrationSlug%22%3A%22mem0%22%7D%5D"
---

# eve Mem0 Agent

Build an eve agent with Mem0 memory to save user facts and preferences, recall relevant context, and scope memory by user.

# eve Mem0 Agent

eve Mem0 Agent is a template for developers building assistants that remember user facts and preferences across conversations. It connects an eve AI agent to Mem0 through tools for saving and retrieving memories. Add your authentication provider to give each user a separate memory scope, then adapt the instructions to your application.

## What can you build with this template?

Build a personal assistant that can use information from earlier conversations when responding to a new request. A user might share a preference for concise answers or describe a work goal. The agent can save that fact and retrieve it in a later session when it relates to the question.

Two tools connect the agent to Mem0. `remember` saves a durable fact or preference through `mem0.add`. `recall_memories` searches for relevant saved facts through `mem0.search`. The instructions ask the model to recall context before answering personal questions and to save information that will remain useful across sessions.

Memory access uses the authenticated session's `principalId`. Both tools derive the memory scope from that identity, so the model doesn't choose another user's ID as a tool argument. This connects personalization to the identity supplied by your authentication provider.

## Why use this template?

Mem0 stores facts and searches for relevant context, which suits artificial intelligence agents whose responses depend on what a user has shared before. This template supplies the tool calls and connects their memory scope to the eve session. You can build AI agents around that pattern without writing the initial Mem0 integration yourself.

Use the starter when you want Mem0 to hold user memory and you plan to add application authentication. The included tools focus on durable facts and preferences. Saving those facts serves a different purpose from preserving every message in a chat interface. Compare the storage and retrieval choices in the guide to [choosing an eve memory provider](https://vercel.com/kb/guide/choose-an-eve-memory-provider) if you are deciding where long-term context should live.

## Why use eve on Vercel?

[eve](https://vercel.com/blog/introducing-eve) is an open-source AI agent framework with durable execution. Its instructions and tools live in project files that you can version in Git. In this template, Mem0 supplies the long-term memory through the two tools; framework durability is a separate execution concern.

Model access runs through [Vercel AI Gateway](https://vercel.com/docs/ai-gateway), using an API key or a linked Vercel project. Adapt `agent/instructions.md` while keeping the memory integration.

## What should you know before deploying?

You need `MEM0_API_KEY` for the memory service and either `AI_GATEWAY_API_KEY` or a linked Vercel project for model access. Follow the [template's setup instructions](https://github.com/mem0ai/eve-mem0-template) to install dependencies and pull your project's environment variables for local development.

The chat channel includes `placeholderAuth()`. Local development, the eve TUI, and your own Vercel deployments can reach the agent, but anonymous browser requests are blocked in production. Add an authentication provider before opening the agent to users who need separate memories.

For a disposable public demo, `none()` allows unauthenticated access with shared memory. Everyone using that demo shares the same memory scope. It does not provide per-user authentication.

## Frequently asked questions

### How does the agent remember information between conversations?

The `remember` tool sends a durable fact or preference to Mem0, and `recall_memories` searches the saved information for context relevant to a request. The agent's instructions guide it to retrieve memories before personal answers and save facts worth using again. This behavior depends on the model calling the tools.

### How does the template keep each user's memory separate?

The memory tools use the authenticated session's `principalId` for their Mem0 scope. Their inputs accept a fact or search query, not a user ID chosen by the model. Your authentication provider must supply the identity for per-user memory.

### Can anonymous visitors use the deployed agent by default?

No. The supplied chat authentication blocks anonymous browser traffic in production while allowing local development and access from the eve TUI or your own Vercel deployments. Replace the placeholder with application authentication for user access. Choosing `none()` instead creates a public demo with shared memory.

### Which credentials does the Mem0 template require?

Set `MEM0_API_KEY` so the memory tools can call Mem0. Model requests also need AI Gateway access, provided by `AI_GATEWAY_API_KEY` or your linked Vercel project. Pull the project's environment variables when running locally.

### How do I choose the best AI agent template for Mem0 memory?

Choose this template when you want Mem0 to store and search user facts across sessions, and you can connect each user to an authenticated identity. It fits applications where preferences or ongoing goals should inform later responses. Choose your memory backend separately from decisions about chat-history storage and the application's sign-in experience.

## Related resources

- [eve documentation](https://eve.dev/docs/getting-started)
- [Deploy eve on Vercel](https://vercel.com/docs/frameworks/agents/eve)

## Related Templates

### [eve TanStack Agent](https://vercel.com/templates/eve/eve-tanstack-agent)

Build a TanStack Start chat with eve, interactive cards, sortable tables, follow-up forms, and conversations with shareable URLs.

### [eve Incident Response Agent](https://vercel.com/templates/eve/eve-incident-response-agent)

Investigate incidents in Slack with an eve agent that tests hypotheses against Datadog, GitHub, and Vercel data and cites sources.

### [eve Memory Agent](https://vercel.com/templates/eve/eve-memory-agent)

Build a Slack assistant that remembers personal preferences and channel conventions, with automatic recall and private Blob storage.

## Related Integrations

### [Mem0](https://vercel.com/marketplace/mem0)

Enable Persistent Memory for your Agents and AI Applications

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
