Get the RepoBrain repository knowledge engine running in minutes.
- Python 3.10+
- pip or conda
- Git
python3 -m venv venv
source venv/bin/activate
pip install -e ./cli -e './engine[dev]'rb-refresh
# Force a new complete rebuild only when intended:
rb-refresh --fullrb-refresh automatically builds, updates, resumes a matching interrupted task, or skips an already-current base. --workspace is the project folder and defaults to the current directory. A clean Git worktree is required.
This command scans the project, builds .repobrain/, and prepares the
repository knowledge base for routed project Q&A.
rb-ask "How does authentication work in this project?" --workspace .The ask pipeline reads the generated structure map, routes to the right module agent, and returns grounded answers with file evidence.
docker-compose up --buildThis builds the image from the current checkout and starts the knowledge-hub MCP
server against /app inside the container. Rebuild after source changes, or edit
docker-compose.yml if you want a bind-mounted development checkout.
Edit docker-compose.yml to:
- Change environment variables
- Mount additional volumes
- Expose different ports
Create a .env file:
# LLM Configuration
OPENAI_BASE_URL=https://your-endpoint/v1
OPENAI_API_KEY=your-key
OPENAI_MODEL=your-model
# MCP Configuration
MCP_ENABLED=true
# Required before rb-ask auto-connects external MCP servers
RB_ALLOW_MCP=true
# Retrieval graph: off, compact, or full
RB_RETRIEVAL_MODE=compact
# Custom settings
LOG_LEVEL=INFO
ARTIFACTS_DIR=artifactsARTIFACTS_DIR supports absolute or relative paths. Relative values are
resolved from the repository root so outputs do not drift into IDE default paths.
This project is optimized for trusted local workspaces. RB_RETRIEVAL_MODE
defaults to compact; full keeps richer evidence artifacts. Common secrets are
redacted before retrieval graph files are written, but snippets can still include
repository content, so do not enable rich retrieval logging for untrusted or
shared workspaces.
The default sandbox is local developer convenience, not an untrusted-code
isolation boundary. SANDBOX_TYPE=microsandbox is opt-in; if the runtime is not
available, the engine warns and falls back to local execution.
The agent automatically manages memory via markdown files:
memory/agent_memory.md(raw entries)memory/agent_summary.md(compressed summary)
To reset:
rm -f memory/agent_memory.md memory/agent_summary.md
rb-refresh --workspace .βββ cli/ # Lightweight rb CLI and templates
βββ engine/repobrain_engine/ # Knowledge engine, hub, MCP server, sandbox
βββ artifacts/ # Plans, reports, and benchmark outputs
βββ memory/ # Markdown interaction memory
βββ .repobrain/ # Generated knowledge base in target repos
See the documentation overview for project structure.
# Run all tests
pytest engine/tests cli/tests
# Run a specific engine test
pytest engine/tests/test_hub_pipeline.py -v# Check if the engine CLI is installed
rb-ask --help
rb doctor --workspace .
# Verify OpenAI-compatible configuration
echo $OPENAI_BASE_URL
echo $OPENAI_API_KEY# Verify engine tools have valid Python files
ls -la engine/repobrain_engine/tools/
# Check for syntax errors
python -m py_compile engine/repobrain_engine/tools/*.py# Check memory file
cat memory/agent_memory.md
# Clear memory
rm -f memory/agent_memory.md memory/agent_summary.mdTo enable MCP servers:
- Set
MCP_ENABLED=truein.env - Set
RB_ALLOW_MCP=trueonly when you trust the configured servers - Configure servers in
mcp_servers.json - Restart the command
MCP stdio servers inherit the process environment plus any configured env
values. Treat every enabled server as code with local permissions. See
MCP Integration Guide for detailed setup.
- Learn Philosophy: Project Philosophy
- Explore MCP: MCP Integration
- Multi-Agent: Swarm Protocol
- Advanced: Zero-Config Features
- Roadmap: Development Roadmap
Questions? Check the Full Index or open an issue on GitHub.