openclaw-brain

openclaw-brain

An MCP server that ingests semiconductor PDFs into a Neo4j knowledge graph, enabling AI agents to query domain knowledge, verify claims against source text, and record design reasoning.

Category
访问服务器

README

openclaw-brain

An engineering knowledge-graph + memory system — the memory and guardrails for an AI circuit-design mentor.

openclaw-brain ingests semiconductor PDFs (textbooks, papers), extracts concepts / equations / typed relationships via LLMs, and stores them in a Neo4j knowledge graph. It is exposed as an MCP server so any MCP-compatible agent (OpenClaw, Claude Code, …) can query domain knowledge, verify it against the original source text, and write its own design reasoning back into the graph.

What it does

  • IngestPDF → typed knowledge graph through an 11-stage pipeline (parse → figures → chunk → extract → ground → match → reason → reconcile → commit → embed → summarize). Only two stages do the heavy "understanding" (an LLM); the rest are mechanical.
  • Serve — exposes ~24 MCP tools: query_knowledge, get_evidence, answer_question, record_hypothesis / record_decision / record_bench_result, merge_concepts, retract_node, …
  • Ground — every node is named, typed, confidence-scored, and traceable to the exact source chunk; a grounding stage drops claims the chunk text doesn't support.

A single unit of the graph looks like this — a real node and a real typed edge, exactly as they sit in the graph:

(Cascode Device) ──[ SOLVES_PROBLEM ]──> (Power Supply Rejection)
  confidence 0.70 · layer L2 (analog/EDA) · evidence: chunk_c635e958d19e
  rationale: "cascode devices raise effective output resistance, improving supply rejection (PSRR)…"

The honest bottom line

The project started with one bet — "make a cheap local model reason like an expensive one" — and measured it false. Because the failure was measured cleanly, two things that genuinely ship came out of it: (1) a grounding / fabrication-control mechanism that drops source-unsupported claims, with measured fabrication near-zero on the evaluation arms (the production-graph fabrication is not yet separately measured), and (2) a debugging discipline that catches when the measurement instrument itself is lying. The full development log — including the dead-ends and the numbers — is in docs/DEVLOG.md.

Quickstart

Requires Python 3.11+ and Neo4j 5.

python -m venv .venv && .venv/bin/pip install -e .
docker compose up -d                        # Neo4j on :7687
.venv/bin/openclaw-brain apply-schema       # constraints + vector indexes

.venv/bin/openclaw-brain serve              # MCP server (stdio — used by the agent)
.venv/bin/openclaw-brain status             # Neo4j health + node counts
.venv/bin/openclaw-brain export-obsidian    # graph → browsable Obsidian vault (~/Semiconductor)

Ingesting a PDF and asking questions both happen through the agent calling MCP tools (ingest_pdf(file_path=…), query_knowledge(query=…)); the full tool list is in src/openclaw_brain/server/mcp_server.py.

Architecture

src/openclaw_brain/
├── agent.py             # BrainAgent — the single public API (all MCP tools delegate here)
├── knowledge/           # pipeline · extraction · reasoning · graph store (Neo4j)
├── memory/              # episodic / semantic / procedural memory + promotion
├── llm/                 # provider (model catalog) + resilience (retry / fallback)
└── server/mcp_server.py # FastMCP server exposing BrainAgent as MCP tools

Routing is local-first: shallow stages run on local/cheap models, the depth-bearing extract and reason stages run on a cheap hosted model (deepseek-v4-flash), and frontier models (Opus / Codex) are used only as the teacher/ceiling. The authoritative stage→model config lives in config/default.toml. See CLAUDE.md for the full module map and docs/DECISIONS.md for the architecture decision records.

Status

Production graph rebuilt clean on deepseek-v4-flash: 5 sources (Razavi textbook + 4 CIS papers) → 4,336 concepts, 2,268 circuit topologies, 581 equations. Knowledge is stored as natural language (concept descriptions + ~19k typed-edge rationales + a verbatim EvidenceVault); embeddings are a rebuildable index, not the asset of record.

.venv/bin/python3 -m pytest tests/ -q         # Neo4j-backed tests auto-skip without a DB

License

MIT © 2026 Rick (github.com/xz0831).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选