Build a Company Brain
Connect sources, ask the company brain, and give agents access through MCP or HTTP.
RetainDB Cloud turns company knowledge into a company brain your agents can read.
The goal of this guide is not to configure every connector. The goal is to get one source indexed, ask one real question, and connect one agent without exposing API keys in the browser.
End State
After this guide you should have:
- one RetainDB project
- at least one indexed source
- a working dashboard query with source context
- one MCP or HTTP agent connection
- a way to inspect sync health, citations, usage, and failures
1. Create Or Choose A Project
Open the dashboard and choose the project your agent will use.
Use separate projects for environments or workspaces:
| Use case | Suggested project |
|---|---|
| production customer agent | production |
| staging tests | staging |
| internal demo | demo |
| one customer workspace | customer or workspace slug |
Keep this value stable. Your sources, memories, API calls, and MCP config all depend on the same project.
2. Connect One Source
Open Dashboard -> Sources.
Use the simplest source that proves the loop:
| Source type | Best for | Notes |
|---|---|---|
| URL | one public docs page | fastest first test |
| Web | docs site or help center | use a narrow crawl first |
| Text | pasted runbook, policy, FAQ, or product notes | easiest private test |
| extracted PDF text | server-side PDF parsing may vary by deployment | |
| GitHub | repos and docs | use Connected Accounts when enabled |
For account-backed tools such as Slack, Notion, Google Drive, Confluence, Jira, Linear, Dropbox, or Box, use Connected Accounts when the connector is enabled for your workspace. If an account connector is not connected, RetainDB should show it as unavailable or coming soon rather than pretending it is ready.
3. Wait For Indexing
Source status should move through this lifecycle:
| Status | Meaning |
|---|---|
pending | source was created and is waiting for a sync job |
connecting | RetainDB is validating access or connector config |
syncing / indexing | documents are being fetched, chunked, embedded, and linked to memory |
indexed / ready | agents can query this source |
failed | RetainDB could not sync it; inspect the error message |
paused | source is intentionally disabled |
Do not judge answer quality before a source is indexed.
4. Ask The Company Brain
Open Dashboard -> Company Brain and ask a real question:
What should a support agent know before replying to a customer about billing retries?A useful result should show:
- an agent-ready context block
- source-derived memories or facts
- document/chunk citations where available
- source names and metadata
- latency and trace metadata
If the result is empty, ask a question that directly mentions something in the source. If it is still empty, check the source status and project selection.
5. Connect An Agent
MCP is the fastest path for agent hosts:
{
"mcpServers": {
"retaindb": {
"command": "npx",
"args": ["-y", "@retaindb/mcp-server@latest"],
"env": {
"RETAINDB_API_KEY": "rdb_...",
"RETAINDB_API_URL": "https://api.retaindb.com",
"RETAINDB_PROJECT": "production"
}
}
}
}Then ask the host to call:
list_sourcescontextread_context_filewith/context/company.md
For servers, jobs, or custom agents, call HTTP directly:
curl -X POST "https://api.retaindb.com/v1/context" \
-H "Authorization: Bearer $RETAINDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project": "production",
"query": "What does our onboarding process say?",
"max_results": 10
}'6. Operate It
Before a real launch, check:
- Sources: each important source is ready, not failed or paused
- Company Brain: test questions return useful source context
- Memory Graph: source, document, and memory nodes appear after indexing
- Agent Filesystem:
/context/company.mdis readable - Developers: API keys are only created for external agents and servers
- Usage: query volume and failed syncs are visible
Production Checklist
- Keep API keys server-side.
- Use dashboard sessions for normal users; they do not need API keys.
- Start with a small number of high-quality sources.
- Delete or pause sources that create noisy answers.
- Treat source deletion as deletion of source-derived documents, chunks, and memories.
- Log
trace_idor latency metadata for support. - Use citations when evaluating answer quality.
Next: Connect Agents, Sources API, or Dashboard Sources.
Was this page useful?
Your feedback helps us make the product easier to ship with.