Docs · static mirror — the interactive version loads with JavaScript.

@rnsk/brain

Workspace knowledge bases and KBrain — document RAG and memory injected server-side when enabled in chat.

Source: https://runstack.engineer/docs/rnsk-brain

Runstack KBrain combines document knowledge bases with lightweight workspace memory. It is internal to the server: the agent still uses only the four meta tools (searchTool, checkAuthentication, initiateConnection, executeTool). When KBrain is on, relevant excerpts and facts are injected into the system prompt before the model runs.

Configure vs use

StepWhere
ConfigureWorkspace Settings → Knowledge Base — create collections, upload files, paste text, manage facts
Use in chatContext popover → Runstack KBrain (persisted per workspace, like MCP server toggles)

KBrain off = no embedding calls, no KB injection, no automatic memory writeback for that workspace.

Supported documents

.md, .txt, .pdf, .doc, .docx, .xls, .xlsx — parsed on the server with npm libraries, chunked for Cloudflare bge-small-en-v1.5 (512-token limit per chunk), embedded via Workers AI.

Requires Cloudflare Account ID + API token under LLM Providers (same credentials as Cloudflare chat models).

Agents

In Studio, when saving an agent you can attach knowledge base collections. If none are selected, chat uses all collections in the workspace when KBrain is enabled.

Memory facts

Facts can be added manually in Settings, extracted from user chat (simple patterns), or from successful tool JSON (stable keys like username, email, teamId). Facts are retrieved alongside document chunks when KBrain is on.

SDK

Programmatic @rnsk/brain npm package is not shipped yet; use the REST API under /api/knowledge/* from your workspace session or extend the server as needed.