nous
Provides a persistent project memory for AI assistants via MCP tools, enabling querying and teaching of concepts, decisions, and patterns stored in an SQLite database.
README
nous
Your project's brain. One command to set up. Zero config to start.
npx nousdb init --hook
That's it. Your AI assistant now has a persistent memory for this project — it learns from your conversations and remembers how things work.
What is this?
Every project has knowledge that lives in developers' heads: how the payment flow works, why we chose Redis over Memcached, the rule about never pushing to main. This knowledge gets lost between sessions, forgotten by new team members, and never reaches your AI tools.
nous fixes that. It's a single SQLite file (.nous/knowledge.db) that stores your project's knowledge and makes it queryable by any AI via MCP.
30-second setup
cd your-project
npx nousdb init --hook
This creates:
.nous/knowledge.db ← the brain (commit to git, share with team)
.claude/settings.json ← Claude Code connects automatically
Done. Just start Claude Code normally — nous is already connected. No server to run, no extra terminal.
Without
--hook, you get query-only (no auto-learning). Without Claude Code, you can still use the CLI to teach and search.
How it works
Your AI can query the brain
After init, Claude Code has 10 MCP tools available. The most useful:
You: "I need to add retry logic to the payment flow"
Claude Code calls nous_context("add retry logic to payment flow")
→ returns relevant concepts, decisions, and patterns
→ Claude now knows how payments work before writing a single line
Your conversations teach the brain
With --hook, nous listens to every conversation (async, non-blocking):
You: "We decided to use Redis for caching because we need pub/sub"
Claude: [implements the feature]
↓ Stop hook fires (background)
↓ reads conversation transcript
↓ heuristic classifier detects "we decided to..."
↓ saves as decision with confidence: 0.6
Next session:
You: "How does caching work?"
Claude Code calls nous_query("caching")
→ "We decided to use Redis for caching because we need pub/sub"
No manual effort. You just have conversations and the brain learns.
You can teach it directly
# How something works
npx nousdb teach concept "Payment Flow" \
"Stripe webhooks hit PaymentController, which dispatches to OrderService"
# Why a decision was made
npx nousdb teach decision "Chose SQLite" \
"Portability over scale — the brain file lives in git"
# Rules to follow
npx nousdb teach pattern "API Responses" \
"Always use ApiResponse wrapper, never return raw arrays"
Three knowledge types
| Type | When to use | Signals |
|---|---|---|
| concept | How something works | "works by", "the flow is", "responsible for" |
| decision | Why something was chosen | "we decided", "opted for", "instead of" |
| pattern | Rules to follow | "always", "never", "make sure", "convention" |
Search
npx nousdb ask "payment"
nous uses hybrid search: FTS5 keyword matching + vector semantic search (OpenAI embeddings) + Reciprocal Rank Fusion to merge results. Entries found by both methods get boosted.
Works without an API key too — falls back to keyword search only.
Semantic search (optional)
For semantic search ("how do we process charges" finds "Payment Flow"), set your OpenAI key:
export OPENAI_API_KEY=sk-...
Without it, everything works — you just get keyword matching instead of semantic.
Sharing with your team
The .nous/knowledge.db file is designed to be committed to git:
initaddsmerge=binaryto.gitattributesautomatically- No WAL sidecar files (journal mode = DELETE)
- ~2.5MB per 1,000 entries
- Every team member and every AI tool gets the same project knowledge
MCP tools
After init, Claude Code (or any MCP client) gets these tools:
| Tool | What it does |
|---|---|
nous_query |
Search the brain (hybrid keyword + semantic) |
nous_teach |
Add new knowledge |
nous_recall |
Get entry by ID or exact title |
nous_update |
Update existing entry |
nous_relate |
Create/query relationships between entries |
nous_forget |
Deprecate or delete entries |
nous_context |
Get all relevant knowledge for a task description |
nous_extract |
Extract knowledge from a block of text |
nous_recent |
Recently added/modified entries |
nous_status |
Brain stats and health |
Manual MCP setup (if not using init)
claude mcp add nous -- npx nousdb serve
You never need to run
nous serveyourself. Claude Code starts it automatically in the background via the config in.claude/settings.json.
CLI reference
npx nousdb init # Interactive setup wizard
npx nousdb init --import --hook # Non-interactive, all features
npx nousdb status # Brain statistics
npx nousdb teach <type> <title> <content> # Add knowledge
npx nousdb ask <question> # Search the brain
npx nousdb import [file] # Import from CLAUDE.md, README, ADRs
npx nousdb viz # Open brain visualization in browser
npx nousdb export [--format json|markdown] # Export for backup or docs
npx nousdb extract --stdin [--auto-save] # Extract knowledge from piped text
How auto-learning works
When you run init --hook, nous installs a Stop hook in Claude Code:
- After every Claude response, the hook fires (async, non-blocking)
- It reads the conversation transcript (
transcript_pathJSONL) - A heuristic classifier scans for decision/concept/pattern signals
- New knowledge is saved with
confidence: 0.6andsource: extracted - Deduplication prevents the same knowledge from being stored twice
The classifier uses ~30 regex patterns (no LLM calls, zero cost, <10ms). It's intentionally conservative — better to miss knowledge than add noise. You can always teach it directly.
What gets created
your-project/
├── .nous/
│ ├── knowledge.db ← the brain (commit this)
│ ├── config.json ← settings + API key (commit this)
│ └── .gitignore ← excludes WAL/journal files
├── .claude/
│ ├── settings.json ← Claude Code auto-connects (no manual server needed)
│ └── hooks/
│ └── nous-extract.sh ← auto-learning script (with --hook)
└── .gitattributes ← binary merge strategy for .db
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。