Introducing a new way to review your PRs.

Read the announcement

thedotmack / claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

View on GitHub

47 documents · Updated Nov 20, 2026

docs / eve-integration

Eve integration

The eve integration connects an eve agent to claude-mem and provides a durable web chat template. It lets an owner recall shared memory across agent clients while keeping chat access, conversation state, and deployment choices under clear control. The main template lives at /home/user/repo/integrations/eve/template.

System role

The integration has two linked parts. The eve provider gives an agent access to selected long-term memory, while the template provides a password or account-protected chat application that runs beside the agent on Vercel. Chat history and eve session state support conversation recovery, but they remain separate from long-term memory.

The integration fits under distribution integrations. Its memory provider is related to the broader agent modes in plugin hooks and agent modes, while its deployment pattern sits beside the other provider pages such as Cursor integration and Grok Bot integration.

Agent memory bridge

The claude-mem provider gives an eve memory slot access to the owner's memory on cmem.ai. Before each turn it searches for the current user message and supplies the result as data. The model can then use explicit search and remember tools for deeper lookup or saving.

flowchart TD
  Turn[New eve turn] --> Recall[Search owner memory]
  Recall --> Context[Add recalled text as data]
  Context --> Model[Run the agent model]
  Model --> Search[Optional memory search tool]
  Model --> Remember[Optional remember tool]
  Search --> Model
  Remember --> Memory[Save an explicit note]

Recall and explicit saving

Recall happens once before each turn and does not require another model call. The provider exposes a slot-specific search tool and a remember tool. It does not capture whole turns automatically because a retried eve operation could otherwise save the same turn more than once.

References: docs/…/eve-integration.mdx• L7-15 docs/…/eve-integration.mdx• L76-78 integrations/…/claude-mem.ts• L14-23

Memory ownership

The memory slot is personal, not a shared memory pool. The template enables it only for local development, the trusted password user, the configured production owner, or the configured owner phone and Apple ID for supported iMessage channels. Other callers receive no recall and no memory tools.

The default template reads across the owner's memory projects, so the scope check is the main privacy boundary. The provider also binds its tools to that scope and sends recalled text as escaped data rather than as agent instructions.

References: integrations/…/claude-mem.ts• L4-12 integrations/…/claude-mem.ts• L24-49 docs/…/eve-integration.mdx• L67-74

Chat application

The template is a web chat front end for an eve session. A user starts or opens an app chat, sends messages through the eve channel, and receives the agent's stream. The app keeps the browser shell usable while it loads history and resumes an existing eve session.

Conversation lifecycle

The chat flow creates an app chat before the first response starts. It records the pending message, sends it to eve, renders the stream, and saves enough state for a refresh to continue or recover the conversation.

sequenceDiagram
  participant U as User
  participant W as Web chat
  participant E as eve session
  participant S as Chat storage
  U->>W: Submit message
  W->>S: Create chat and mark message pending
  W->>E: Send message
  E-->>W: Stream session events
  W->>S: Save events and session cursor
  E-->>W: Settle or pause turn
  W->>S: Save final snapshot and clear pending message

References: integrations/…/how-the-chatbot-works.md• L209-237 integrations/…/how-the-chatbot-works.md• L312-345 integrations/…/how-the-chatbot-works.md• L397-428

Authentication boundary

The web channel accepts several authentication contexts and converts them into eve principals. Starter mode uses a shared password cookie. Production mode uses a Vercel account through Better Auth. Local development and Vercel service identity remain available for their matching environments.

This boundary serves both the web application and the eve route. It also gives the memory scope enough identity information to decide whether a caller is the owner.

References: integrations/…/eve.ts• L1-8 integrations/…/eve-auth.ts• L6-55 integrations/…/how-the-chatbot-works.md• L525-576

Conversation persistence

The app stores two kinds of chat state. An app chat provides the stable URL, title, and event history. An eve session provides the remote session identity and stream position needed to resume work. Long-term claude-mem data is outside both stores.

Starter mode keeps this state in versioned browser storage for one browser. Production mode stores user-owned chats, eve session state, pending messages, and ordered stream events in the database. The two stream positions must stay distinct: one resumes eve, and the other orders the local event log.

References: integrations/…/how-the-chatbot-works.md• L58-93 integrations/…/persistence-client.ts• L27-133 integrations/…/schema.ts• L64-101 integrations/…/local-store.ts• L7-18

Deployment model

The template composes an eve service with a Next.js web service. Vercel routes the web surface to the web service, while the same deployment exposes the eve channel to the chat application. This gives the browser a same-origin path to the agent instead of making it call a model endpoint directly.

Starter deployment

The one-click deployment creates a database-free personal agent. It needs a strong EVE_CHAT_PASSWORD and a CLAUDE_MEM_API_KEY. The password protects the chat and browser storage holds chat history, so this mode is suitable for one trusted operator rather than independent users.

Memory remains limited to the owner rules even when several people know the password. If the password and full production setup are both absent, the app stays unavailable instead of accepting an incomplete configuration.

References: integrations/…/setup-and-deploy.md• L20-36 integrations/…/setup.ts• L40-112

Production deployment

Production mode adds per-user identity, database-backed history, and distributed rate limits. It requires a database, Better Auth with the required Vercel OAuth scopes, and an Upstash-compatible Redis setup. Database migrations must be applied before chat is enabled.

The setup path provisions the Vercel resources and supplies environment values. A redeploy is required after changes to environment values, storage products, or Vercel Connect connectors so the running service uses the new configuration.

References: integrations/…/setup-and-deploy.md• L53-66 integrations/…/setup-and-deploy.md• L82-106 integrations/…/setup-and-deploy.md• L128-172 integrations/…/setup-and-deploy.md• L201-231

Optional channels and connections

The web chat is the default channel. Optional Vercel Connect additions can provide Slack, Notion, Linear, and Sentry access, while eve channel add-ons can provide iMessage. These integrations are separate from memory ownership: an external caller receives owner memory only when its identity matches the configured owner handle.

The chat UI can indicate which external connections are enabled for a turn. A connection that needs authorization pauses that turn until the user connects it or skips the request.

References: integrations/…/setup-and-deploy.md• L257-294 docs/…/eve-integration.mdx• L28-36 integrations/…/how-the-chatbot-works.md• L434-479

Service composition

The deployment definition places the Next.js app at apps/web and sends the public routes to that web service. The eve agent selects the default model and the eve channel connects the web request to the authenticated app session.

References: integrations/…/vercel.ts• L1-12 integrations/…/agent.ts• L1-5 integrations/…/eve.ts• L1-8

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the memory scope rules aligned with every new authentication source or channel. A new caller path can expose the owner's memory if it is admitted without an owner check.
  • Keep the eve session cursor separate from the local event index in both browser storage and database storage.
  • Keep pending-message recovery tied to a settled eve turn so refreshes do not resend a message that already completed.
  • Keep production readiness tied to database migrations, OAuth scopes, and rate-limit configuration. A deployment can have all environment names present and still be unable to serve chat.
  • Redeploy after changing Vercel environment values or Connect bindings so the live service does not use stale deployment settings.

Important failure modes

TriggerConsequenceGuard
A caller passes the password but is not the memory ownerThe caller could read the owner's cross-project memoryRestrict the memory scope to the owner rules in agent/…/claude-mem.ts.
A chat saves the eve cursor as its event indexResume can skip or replay stream dataKeep eve's session state and the ordered local event log as separate values.
Production OAuth lacks the email scopeSign-in ends at the auth error pageEnable openid, email, and profile for the Vercel app.
Production tables are not migratedSetup marks the app unavailableRun the production database migration before serving chat.
cmem.ai is unavailable during a turnThe turn runs without memory recallReport memory unavailability and continue the turn without treating it as a chat failure.
Automatic capture retries the same eve operationOne turn can be saved more than onceKeep saving explicit through the remember tool until the memory API supports idempotency.

Key files

FileWhy to read it
docs/…/eve-integration.mdxStates the provider contract, memory behavior, security limits, and supported deployment use.
integrations/…/claude-mem.tsDefines who can use the owner's memory and how recall and saves connect to cmem.ai.
integrations/…/eve.tsShows the eve web channel and its accepted authentication contexts.
integrations/…/eve-auth.tsMaps app login state to eve principals.
integrations/…/how-the-chatbot-works.mdExplains the chat lifecycle, resume behavior, authorization pauses, and storage model.
integrations/…/schema.tsShows the durable relationship between users, chats, sessions, pending messages, and stream events.
integrations/…/persistence-client.tsShows how the same chat contract selects browser or database storage.
integrations/…/setup.tsDefines when starter, local, production, or unavailable setup is active.
integrations/…/vercel.tsShows how the eve and Next.js services are composed for deployment.
integrations/…/setup-and-deploy.mdDescribes one-click setup, production resources, OAuth, migrations, and optional connections.