Token导航 LogoToken导航TokenDH.com
second brain server logo
文档知识stdio官方级别未说明来源级核验

second brain server

MCP Server

基于Rust构建的个人知识操作系统,可将Markdown笔记索引为可搜索、语义关联的知识库,支持全文检索、语义搜索和AI辅助工作流。

工具数

17

提示词数

0

GitHub Stars

0

资源数

0
知识管理本地优先RustClaude搜索Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

calebbarzee

提供方

calebbarzee

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python3 test-mcp-http.py # 51 HTTP integration tests (requires running server)

详细介绍

第二大脑

基于Rust构建的个人知识操作系统。它将你的普通markdown笔记索引到一个可搜索的、语义连接的知识库中——由PostgreSQL+pgvector支持,并通过以下方式公开 主控程序 因此,任何人工智能助手都可以阅读、搜索和写你的笔记。

为什么

你已经记笔记了。它们存在于分散的目录中,跨项目,处于不同的完整性阶段。问题不在于写作,而在于 *发现* 你六个月前写的东西,看到了跨领域想法之间的联系,并为你的人工智能工具提供了实际帮助所需的背景。

Second Brain通过将您的markdown文件视为真实来源并构建一个支持全文搜索、语义(向量)搜索、链接图遍历和可组合AI工作流的派生索引来解决这个问题——所有这些都可以从Claude Code、Claude Desktop、Neovim或任何兼容MCP的客户端访问。

您的文件保留在磁盘上,无论您使用何种结构。无需锁定,无需特殊语法,无需迁移。

运作原理

You write markdown  -->  Watcher detects change  -->  Parser extracts structure
                                                            |
You ask a question  //working` (例如。, `alice/2026-03-18/working`)

自定义:通过a `branch` 参数到 `session_init` (例如。, `alice/2026-03-18/notes_on_bees`)

### 运作原理

1. **`session_init`** 在带有日期戳的分支上创建git工作树
1. **`note_create`/`note_update`** 使用AI作者身份写入工作树并自动提交
1. 注释可以在数据库中立即搜索(写入时摄入)
1. 会话结束后,工作台会被清理干净,但 **分支持续存在**
1. 合并到 `main` 是一个深思熟虑的步骤(PR或手动合并)

受保护的分支(`main`, `master`, `staging`, `dev`)从不直接写信给。AI承诺使用 `--author` 所以它们与人类的行为不同 `git log`.

只读工具(搜索、列表、阅读)不需要会话。

## 建筑

second-brain (Cargo workspace) | |-- sb-core Shared foundation: models, DB queries, markdown parser, | ingestion pipeline, file search. Everything depends on this. | |-- sb-embed Embedding pipeline: pluggable providers, markdown chunker, | batch processor. | |-- sb-sync File watcher (notify v7) + sync processor. Detects file | changes, ingests, embeds. Runs as a background tokio task. | |-- sb-skills Skill engine: composable workflows for summarize, reflect, | continue-work, connect-ideas, contextualize. | |-- sb-server MCP server binary. 17 tools via rmcp. Supports stdio | (local) and HTTP (network) transports. | |-- sb-cli CLI for manual ingestion, search, embedding, and skills.


有关更深入的架构细节(数据流、嵌入策略、链接解析、数据库模式),请参阅 [docs/architecture.md](docs/architecture.md).

## 发展

对于没有Docker的本地开发(从源代码构建):

Start just the database

docker compose up -d db

Start Ollama on the host (or use docker compose up -d ollama from the dev compose)

ollama serve & ollama pull nomic-embed-text

Build

cargo build --release

Run the MCP server (stdio mode for Claude Code)

./target/release/second-brain

Or HTTP mode

./target/release/second-brain --transport http --port 8080


通过justfile执行开发命令:

just db-up # start postgres just db-down # stop services just db-reset # wipe and recreate the database just test # run all tests just ci # fmt + clippy + test just server # run MCP server in dev mode


互动 `setup.sh` 脚本也可以遍历本地设置,但Docker部署通过 `deploy.sh` 是主要支持的路径。

## 命令行界面

这 `sb` CLI可通过以下方式在容器内使用 `./deploy.sh cli`,或在当地建造 `cargo build --release -p sb-cli`:

Via deploy.sh (runs inside container)

./deploy.sh cli search "signal processing" ./deploy.sh cli semantic "radio frequency" ./deploy.sh cli skill summarize --period this-week

Or locally

sb search "signal processing" sb semantic "radio frequency interference" sb ingest ~/notes sb embed sb skill summarize --period this-week sb projects sb classify ~/notes/TODO.md volatile


## 测试

cargo test --workspace # 95 unit + integration tests cargo clippy --workspace # lint checks python3 test-mcp-http.py # 51 HTTP integration tests (requires running server)


### 板条箱测试覆盖率

|板条箱|测试|覆盖范围|
|-------|-------|----------|
|sb core | 62 |配置、摄取、生命周期、标记、路径映射、项目检测、项目同步、工作树|
|sb embed|10|分块器,TEI提供商|
|sb技能|16|git_ops(分支验证、提交、快照)、时间周期|
|sb sync|2|监视器(文件更改检测)|
|sb core(集成)|5|DB连接、CRUD、全文搜索、pgvector|

集成测试套件涵盖了依赖数据库的模块(DB/\*)(`test-mcp-http.py`)以及 `tests/db_integration.rs` 测验。

## 延伸阅读

- **[docs/architecture.md](docs/architecture.md)** --数据库模式、数据流、嵌入策略、链接解析
- **[ROADMAP.md](ROADMAP.md)** --未来计划和参考项目

## 许可证

麻省理工学院

目录标签

目录标签

知识管理本地优先RustClaude搜索本地部署语义搜索Markdown解析AI集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

17

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP