██████╗ █████╗ ██╗ ██╗ ██╔══██╗██╔══██╗ ██║ ██║ ██████╔╝███████║█████╗███████║ ██╔══██╗██╔══██║╚════╝██╔══██║ ██║ ██║██║ ██║ ██║ ██║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝_
Own your context
TL;DR: Clone this repository and you'll have a local SQLite knowledge graph on your computer plus a UI and standalone MCP server. External AI agents can read and write the graph, while the app owns chunking and embedding from node source.
Clone RepositoryWhat This Does
Stores knowledge locally — Notes, bookmarks, ideas, research in a SQLite database on your machine
Provides a UI — Browse, search, and organize your nodes at localhost:3000
Exposes an MCP server — Claude Code and other MCP clients can query and add to your knowledge base
Your data stays on your machine. Nothing is sent anywhere unless you configure an API key.
Install
git clone https://github.com/bradwmorris/ra-h_os.git
cd ra-h_os
npm install
npm rebuild better-sqlite3
./scripts/dev/bootstrap-local.sh
npm run devOpen localhost:3000. Done.
Requirements
- •Node.js 20.18.1+ — nodejs.org
- •macOS — Works out of the box
- •Linux/Windows — Requires building sqlite-vec manually (see below)
OpenAI API Key
Optional but recommended. Without a key, you can still create and organize nodes manually.
With a key, you get:
- •Auto-generated descriptions when you add nodes
- •Semantic search and source-aware retrieval
- •Semantic search (find similar content, not just keyword matches)
Cost: Less than $0.10/day for heavy use. Most users spend $1-2/month.
Setup: The app will prompt you on first launch, or go to Settings → API Keys.
Get a key at platform.openai.com/api-keys
Where Your Data Lives
~/Library/Application Support/RA-H/db/rah.sqlite # macOS
~/.local/share/RA-H/db/rah.sqlite # Linux
%APPDATA%/RA-H/db/rah.sqlite # WindowsThis is a standard SQLite file. You can:
- •Back it up by copying the file
- •Query it directly with
sqlite3or any SQLite tool - •Move it between machines
Connect Claude Code (or other MCP clients)
Add to your ~/.claude.json:
{
"mcpServers": {
"ra-h": {
"command": "npx",
"args": ["--yes", "ra-h-mcp-server@2.1.2"]
}
}
}Restart Claude Code fully (Cmd+Q on Mac, not just closing the window).
Run RA-H once first so the database exists. The standalone MCP server can write nodes without the app running, but the app owns chunking and embedding from node source.
Verify it worked: Ask Claude whether RA-H tools are available. You should see tools like queryNodes, retrieveQueryContext, and createNode.
Available Tools
| Tool | What it does |
|---|---|
getContext | Get graph overview for orientation |
queryNodes | Direct node lookup by title, description, or source |
retrieveQueryContext | Broader graph grounding for substantive current-turn work |
createNode | Create a new node |
getNodesById | Load nodes by ID |
updateNode | Edit an existing node |
createEdge | Create a confirmed edge |
updateEdge | Update an edge explanation |
queryEdge | Find connections |
listSkills | List available skills |
readSkill | Read a skill |
writeSkill | Create or update a skill |
deleteSkill | Delete a skill |
searchContentEmbeddings | Search through source content |
sqliteQuery | Run read-only SQL queries (SELECT/WITH/PRAGMA) |
Example Prompts for Claude Code
- •"What's in my knowledge graph?"
- •"Search my knowledge base for notes about React performance"
- •"Add a node about the article I just read on transformers"
- •"Search my graph for notes about React performance"
Direct Database Access
Query your database directly:
# Open the database
sqlite3 ~/Library/Application\ Support/RA-H/db/rah.sqlite
# List all nodes
SELECT id, title, created_at FROM nodes ORDER BY created_at DESC LIMIT 10;
# Search by title
SELECT title, description FROM nodes WHERE title LIKE '%react%';
# Find connections
SELECT n1.title, e.explanation, n2.title
FROM edges e
JOIN nodes n1 ON e.from_node_id = n1.id
JOIN nodes n2 ON e.to_node_id = n2.id
LIMIT 10;See ra-h.app/docs/open-source for full schema documentation.
Commands
| Command | What it does |
|---|---|
npm run dev | Start the app at localhost:3000 |
npm run build | Production build |
npm run type-check | Check TypeScript |
Linux/Windows
The bundled sqlite-vec binary only works on macOS. For other platforms:
- 1.Build sqlite-vec from github.com/asg017/sqlite-vec
- 2.Place at
vendor/sqlite-extensions/vec0.so(Linux) orvec0.dll(Windows)
Without sqlite-vec, everything works except semantic/vector search.
More
- Full docs: ra-h.app/docs/open-source
- Issues: github.com/bradwmorris/ra-h_os/issues
- License: MIT