Give your AI agents persistent memory in one API call.
npm install brainbase-sdkimport { Brainbase } from "brainbase-sdk";
const brain = new Brainbase({ apiKey: "bb_live_..." });
// Search your brain
const results = await brain.search("who do I know at Apple?");
// → [{ slug: "people/tim-cook", title: "Tim Cook", score: 0.92, ... }]
// Get a page
const page = await brain.getPage("people/garry-tan");
// → { title: "Garry Tan", content: "...", links: [...], timeline: [...] }
// Brain health
const stats = await brain.health();
// → { page_count: 687, link_count: 257, brain_score: 75 }
// Full knowledge graph
const graph = await brain.graph();
// → { nodes: [...], edges: [...] }
// Page links
const links = await brain.links("people/preetham-kyanam");
// → { outgoing: [...], incoming: [...] }Connect any MCP-compatible agent directly:
// OpenCode / Claude Code / Cursor config
{
"mcpServers": {
"brainbase": {
"command": "node",
"args": ["brainbase-mcp"],
"env": { "BRAINBASE_URL": "https://brainbase.belweave.ai" }
}
}
}Or use the HTTP endpoint: POST /api/mcp with Authorization: Bearer bb_liv...
brainbase search "garry tan"
brainbase health
brainbase page "people/garry-tan"
brainbase links "people/preetham-kyanam"
brainbase graphAll read endpoints are public. Write endpoints require API key auth.
/api/brain/healthBrain statistics and health score.
/api/brain/statsDetailed brain statistics (pages by type, embed coverage, most connected).
/api/brain/search?q=...Full-text + ILIKE search across all pages.
/api/brain/list?type=&limit=&offset=List all pages with metadata. Filter by type.
/api/brain/page/<slug>Single page with content, links, and timeline.
/api/brain/timeline/<slug>Timeline entries for a page.
/api/brain/graphFull knowledge graph (nodes + edges).
/api/brain/traverse?slug=&depth=&direction=Graph traversal from a page (out/in/both, max depth 5).
/api/brain/page/<slug>Create or update a page. Body: {title, type?, content?, frontmatter?}
/api/brain/page/<slug>Delete a page and its associated data.
/api/brain/linkCreate a link. Body: {from, to, link_type?}
/api/brain/linkRemove a link. Body: {from, to}
/api/brain/timelineAdd timeline entry. Body: {slug, date, summary, detail?, source?}
/api/mcpJSON-RPC MCP endpoint. 16 tools: search, query, get_page, get_links, get_backlinks, get_timeline, get_health, get_stats, get_graph, list_pages, traverse_graph, put_page, delete_page, add_link, remove_link, add_timeline_entry.
Brainbase is built on GBrain by Garry Tan. Each user gets their own isolated Postgres database on Supabase with pgvector for hybrid search. The knowledge graph uses typed wikilinks for relational queries that vector search alone can't reach.