Connect a knowledge base to an agent
You can connect from either side; both create the same connection.- From the knowledge base
- From the agent
Open the knowledge base, then the Agents tab. Under Connected agents, pick an agent, choose its Access, and click Connect an agent.This tab is also where you change an agent’s access later, or click Disconnect.
Connecting requires the Admin or Builder role. From the agent side, you can only connect knowledge bases you are allowed to edit.
Choose the access mode
Each connection has an access mode (ContextAccessMode). For read and write access, it also has a write policy.
A knowledge base an agent can write to is that agent’s memory. See Memory for how agents write and how to review what they wrote.
Set the agent’s exposure
An agent’s Exposure (contextExposure) decides which knowledge bases it sees at all. It is set on the agent’s Data access tab, under Connected contexts.
- Every new agent uses Connected only. An agent with nothing connected starts every run with no shared context.
- Whole workspace exists only on agents that had it before exposure control was introduced. Once such an agent is switched to Connected only, it cannot be switched back.
- An agent with a data scope is always Connected only.
- Exposure never grants write access. Only a Read & write connection does.
How the agent sees the files
At the start of each run, DataGen mounts the knowledge bases the agent may read into its sandbox, read-only, one directory per knowledge base:- Always the live version. A publish, a rollback or an agent write shows up on the agent’s next turn.
- Read-only. Nothing an agent writes under
/mnt/context/is kept. An agent with Read & write access changes a knowledge base only through itswrite_contexttool, and its own mounted copy does not show the change until the mount refreshes. - Treat agent-written files with care. Agents are told that files in a knowledge base may have been written by other agents, and to check the version history when something looks wrong.
Connect a knowledge base to an app
Apps use knowledge bases at build time only. Open the app, then the Tools & knowledge tab, and connect knowledge bases under Knowledge. You can also connect them in the App Builder’s configuration pane, under Knowledge bases.- The App Builder’s sandbox mounts the connected knowledge bases read-only under
/mnt/context/contexts/, as background for writing the app. - The published app never sees them. If the running app needs the information, have the builder write it into the app’s own files.
- App connections have no access mode and no exposure setting: the builder reads exactly what is connected.
Next
Memory
Let agents record what they learn in a knowledge base, and review what they wrote.
Skills
Give agents reusable procedures with reviewed skills.