One Brain in an eve agent.
eve is Vercel’s framework for agents. Give an eve agent your team’s One Brain through the MCP server, with no code, or make One Brain the agent’s memory with @useonebrain/eve.
Integrations · eve
Before you start.
- No code: the MCP server. The agent gets One Brain’s six tools and calls them when it decides to. Nothing comes in on its own, and nothing is stored back.
- The package,
@useonebrain/eve. One Brain becomes the agent’s memory. Before each turn, what matches the user’s message comes in. After it, the turn is stored as a session One Brain learns from. The workspace’s skills become the agent’s skills.
Both sign in with a workspace agent key (ob_...) in ONEBRAIN_API_KEY. ONEBRAIN_URL defaults to https://api.useonebrain.com. A workspace admin makes the key with the onebrain CLI and gives the agent the folders it should use:
onebrain admin agents create eve-agent --workspace-agent
onebrain admin keys create eve-agent
onebrain admin grants put clients --principal eve-agent --role edit
onebrain admin grants put skills --principal eve-agent --role viewedit on the folders it may save to, and view on skills so it loads the workspace’s skills. eve runs on Node 24.
No code: the MCP server.
Write the connection with eve alone:
// agent/connections/onebrain.ts
import { defineMcpClientConnection } from "eve/connections";
export default defineMcpClientConnection({
url: `${process.env.ONEBRAIN_URL ?? "https://api.useonebrain.com"}/mcp`,
description: "The team's One Brain: files, skills and memories.",
auth: { getToken: async () => ({ token: process.env.ONEBRAIN_API_KEY ?? "" }) },
approval: ({ toolName }) =>
toolName.endsWith("__write") || toolName.endsWith("__forget") ? "user-approval" : "not-applicable",
});The model finds the tools with eve__search and calls them as onebrain__search, onebrain__read, onebrain__list, onebrain__remember, onebrain__write and onebrain__forget. write and forget wait for a person’s approval.
Or add One Brain’s registry to the agent once, then add the connection:
eve registry add @onebrain=https://useonebrain.com/r/{name}.json
eve add @onebrain/connectionThat writes agent/connections/onebrain.ts with the package’s connection:
import { onebrainConnection } from '@useonebrain/eve';
export default onebrainConnection();The package: One Brain as the agent’s memory.
eve add @onebrain/memory
eve add @onebrain/skillsOr install the package and write the two files yourself:
npm install @useonebrain/eve// agent/memory/onebrain.ts
import onebrain from '@useonebrain/eve';
import { defineMemory } from 'eve/memory';
export default defineMemory({
description: "The team's One Brain: files, skills and memories.",
provider: onebrain(),
scope: 'workspace',
});// agent/skills/onebrain.ts
import { onebrainSkills } from '@useonebrain/eve';
export default onebrainSkills();What happens on a turn
- Recall. The user’s message is searched in One Brain. The top 5 results come in as One Brain data, each with its file path or memory id and a short snippet.
- Tools. The model gets the same six tools as over MCP.
writeandforgetwait for approval. - Skills. The skills the key may read are loaded once per session, with their files. The model loads one with
eve__skillwhen it fits. - Capture. The turn’s own messages are stored as one session, with the ref
eve:<session id>#turn-<n>: what the person wrote, the agent’s replies, its tool calls and their results. Capture is on by default. It goes to the workspace’s capture folder (an admin sets it in One Brain under Settings > General) unless you passcapture: { folder }. A workspace agent’s key needs one or the other. To store nothing, passonebrain({ capture: false }).
provider: onebrain({ capture: false }), // store nothing
provider: onebrain({ capture: { folder: 'agents/eve' } }), // in this folderWhen One Brain can’t be reached, recall and capture log a warning and the turn goes on without them. Each request gives up after 15 seconds.
See what was captured
curl -s "$ONEBRAIN_URL/v1/workspaces/<workspace>/sources?kind=session&limit=2" -H "Authorization: Bearer $ONEBRAIN_TOKEN"
curl -s "$ONEBRAIN_URL/v1/workspaces/<workspace>/sources/<id>" -H "Authorization: Bearer $ONEBRAIN_TOKEN"The second answer’s externalRef is the turn’s ref, and excerpt is the start of what was stored. The package README has every option, and what capture leaves out.
Each person’s own access.
With one workspace key, everyone who talks to the agent shares what that key may read. To give each person their own access, pass apiKey a function. It gets the eve session and returns that person’s One Brain token. Then scope the slot per person. With Vercel Connect, the person signs in to One Brain through the connection the first time the agent needs it, and the memory slot uses the same token:
// agent/connections/onebrain.ts
import { onebrainConnection } from '@useonebrain/eve';
import { connect } from '@vercel/connect/eve';
export default onebrainConnection({ auth: connect('onebrain') });// agent/memory/onebrain.ts
import onebrain from '@useonebrain/eve';
import { getToken } from '@vercel/connect';
import { defineMemory } from 'eve/memory';
import { byPrincipal } from 'eve/memory/scope';
export default defineMemory({
description: 'What the signed-in person may read in One Brain.',
provider: onebrain({
apiKey: ({ session }) => {
const caller = session.auth.current;
if (!caller?.principalId) throw new Error('No signed-in person');
return getToken('onebrain', {
subject: { type: 'user', id: caller.principalId, issuer: caller.issuer },
});
},
// The connection gives the tools: the slot recalls and captures.
tools: false,
}),
scope: byPrincipal,
});When the function throws, for example for a person who hasn’t signed in yet, recall and capture warn with its error and skip that turn. The next turn asks again.
The registry.
One Brain’s eve registry is on this site, at https://useonebrain.com/r/{name}.json. Add it to an agent once:
eve registry add @onebrain=https://useonebrain.com/r/{name}.jsonEach item writes one file and installs @useonebrain/eve.
@onebrain/memorywritesagent/memory/onebrain.ts. One Brain as the agent's memory: recall, capture and the six tools.@onebrain/skillswritesagent/skills/onebrain.ts. The workspace's skills, as the agent's own.@onebrain/connectionwritesagent/connections/onebrain.ts. The MCP server as a connection: the tools only.
The catalog eve registry list reads is /r/registry.json.
A ready-made agent.
The eve template is an agent with the package already mounted: recall before each reply, search, read and save, and each turn stored back. It starts from eve’s memory-agent template. Deploying it asks for ONEBRAIN_API_KEY and ONEBRAIN_URL.
Give every person and agent the same brain.
$25 a seat at launch. 14 days free, no card.