Browse docs

Getting Started
Tap to expand
StartUpdated 2026-05-30

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 caseSuggested project
production customer agentproduction
staging testsstaging
internal demodemo
one customer workspacecustomer 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 typeBest forNotes
URLone public docs pagefastest first test
Webdocs site or help centeruse a narrow crawl first
Textpasted runbook, policy, FAQ, or product noteseasiest private test
PDFextracted PDF textserver-side PDF parsing may vary by deployment
GitHubrepos and docsuse 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:

StatusMeaning
pendingsource was created and is waiting for a sync job
connectingRetainDB is validating access or connector config
syncing / indexingdocuments are being fetched, chunked, embedded, and linked to memory
indexed / readyagents can query this source
failedRetainDB could not sync it; inspect the error message
pausedsource 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:

txt
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:

json
{
  "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:

  1. list_sources
  2. context
  3. read_context_file with /context/company.md

For servers, jobs, or custom agents, call HTTP directly:

bash
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.md is 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_id or 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.