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

Open Brain

MCP Server

Open Brain是一个个人知识管理系统,通过语义嵌入和向量搜索帮助用户存储、搜索和分析重要信息。

工具数

1

提示词数

0

GitHub Stars

36

资源数

0
知识管理PythonClaude搜索Claude

安装说明

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

作者 / 组织

benclawbot

提供方

benclawbot

最后核验

2026/5/17 20:21

快速接入

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

命令预览

pip install -e .

详细介绍

🧠 开放大脑

具有MCP接口的个人语义记忆系统。存储、搜索和分析对你来说重要的一切。

](https://github.com/benclawbot/open-brain/stargazers) ](https://hub.docker.com/r/benclawbot/open-brain) ![License](https://github.com/benclawbot/open-brain/blob/master/LICENSE)

什么是开放大脑?

开放的大脑是 个人知识管理系统 它就像你的第二个大脑。它

  • 📥 摄入 来自任何地方的数据(电报、WhatsApp、克劳德代码、Gmail、文件)
  • 🧠 嵌入 语义上的一切(OpenRouter、OpenAI、Ollama或任何自定义API)
  • 🔍 搜索 立即使用向量相似度
  • 📊 分析 趋势、集群和联系
  • 🔔 通报 你的重要变化
  • 🌐 供应 通过MCP、REST API、CLI或仪表板

把它想象成 黑曜石与ChatGPT内存相遇 --但可以从任何工具访问。

______________________________________________________________________

✨ 特性

核心

  • 语义搜索 --通过意义而不仅仅是关键字来寻找记忆
  • 自动标记 --自动主题和实体提取
  • 实体识别 --提取人物、地点、组织、日期
  • 趋势分析 --查看哪些主题正在出现或正在减少

集成

  • MCP服务器 --从Claude、Codex或任何MCP客户处使用
  • REST API --任何应用程序的HTTP访问
  • 命令行界面 --用于快速操作的命令行界面
  • 源连接器 --从Telegram、WhatsApp、Gmail、Claude Code导入

用户界面

  • 流线型仪表板 --可视化记忆、统计数据和趋势
  • 周报 --自动降价报告

______________________________________________________________________

🚀 快速开始

先决条件

  • 码头工人 +Docker编写
  • 至少2GB RAM
  • (可选)用于嵌入的OpenRouter API密钥

1.克隆和配置

git clone https://github.com/benclawbot/open-brain.git
cd open-brain

# Copy environment file
cp .env.example .env

2.设置环境变量

编辑 .env:

# Database
DB_PASSWORD=your_secure_password

# Embeddings (OpenRouter = FREE)
OPENROUTER_API_KEY=your_openrouter_key

# Optional: Telegram notifications
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
没有API密钥? OpenRouter有一个免费层。只需在以下网址注册 openrouter.ai.

3.开始一切

docker compose up -d

4.访问服务

服务URL描述
仪表盘http://localhost:8501流线型UI
MCP服务器http://localhost:8080MCP协议
REST APIhttp://localhost:8000HTTP API
API文件http://localhost:8000/docsSwagger文档

______________________________________________________________________

🔧 配置

中的所有设置 config/settings.yaml:

database:
  host: postgres
  port: 5432
  name: openbrain
  user: postgres
  password: ${DB_PASSWORD}

embedder:
  # Providers: openrouter, openai, ollama, custom
  provider: openrouter
  model: text-embedding-3-small
  dimensions: 768

mcp:
  host: 0.0.0.0
  port: 8080

api:
  host: 0.0.0.0
  port: 8000

dashboard:
  port: 8501

嵌入器提供商

提供者环境变量注释
开放路由 (默认)OPENROUTER_API_KEY免费套餐可用
OpenAIOPENAI_API_KEY已付
奥拉马OLLAMA_BASE_URL本地,免费
自定义CUSTOM_API_URL + CUSTOM_API_KEY任何兼容OpenAI的

______________________________________________________________________

📡 用法

命令行界面

# Install
pip install -e .

# Search memories
openbrain search "what did I learn about AI"

# Store a memory
openbrain store "Meeting with Oliver about trading bot" --source telegram --tags ai,trading

# Show stats
openbrain stats

# Generate weekly report
openbrain report

# Start API server
openbrain serve

MCP工具

将任何MCP客户端连接到 http://localhost:8080:

# Example: Using memory_search
{
  "name": "memory_search",
  "arguments": {
    "query": "trading strategies",
    "limit": 5,
    "sources": ["telegram", "claude"]
  }
}

REST API

# Search
curl -X POST http://localhost:8000/memories/search \
  -H "Content-Type: application/json" \
  -d '{"query": "AI agents", "limit": 5}'

# Store
curl -X POST http://localhost:8000/memories \
  -H "Content-Type: application/json" \
  -d '{"content": "New idea", "source": "manual"}'

# Stats
curl http://localhost:8000/stats

______________________________________________________________________

🏗 建筑

┌─────────────────────────────────────────────────────────────┐
│                        Clients                               │
│   Claude Code | Codex | OpenClaw | Custom Apps | CLI       │
└─────────────────────────┬───────────────────────────────────┘
                          │ MCP / HTTP / CLI
                          ▼
┌─────────────────────────────────────────────────────────────┐
│                      Open Brain                              │
│  ┌─────────────┐  ┌──────────────┐  ┌──────────────────┐   │
│  │   MCP API   │  │  REST API   │  │     CLI Tools    │   │
│  └─────────────┘  └──────────────┘  └──────────────────┘   │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │              Application Layer                          │ │
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐  │ │
│  │  │Extractors│ │  Tagger  │ │Analytics │ │ Notifier │  │ │
│  │  │ (Entities│ │ (Auto-tag│ │ (Trends) │ │(Telegram)│  │ │
│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘  │ │
│  └─────────────────────────────────────────────────────────┘ │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │              Embedder (Multi-Provider)                  │ │
│  │   OpenRouter | OpenAI | Ollama | Custom                 │ │
│  └─────────────────────────────────────────────────────────┘ │
└─────────────────────────┬───────────────────────────────────┘
                          │
┌─────────────────────────▼───────────────────────────────────┐
│                   PostgreSQL + pgvector                      │
│   memory table with vector embeddings, GIN indexes          │
│   for tags/entities, IVFFlat for similarity search          │
└─────────────────────────────────────────────────────────────┘

组件

组件技术目的
数据库PostgreSQL+pgvector存储+向量搜索
MCP服务器FastMCPAI代理工具界面
REST APIFastAPIHTTP访问
CLI单击终端命令
仪表板流媒体可视化用户界面
嵌入器请求多提供者嵌入
提取器NLTK/spaCy实体提取

______________________________________________________________________

📁 项目结构

open-brain/
├── config/
│   └── settings.yaml          # Configuration
├── src/
│   ├── main.py                # MCP server entry
│   ├── db/                    # Database layer
│   │   ├── schema.sql
│   │   ├── connection.py
│   │   └── queries.py
│   ├── embedder/              # Multi-provider embeddings
│   ├── extractors/            # NER + tagging
│   ├── analytics/             # Trends + reports
│   ├── connectors/            # Source importers
│   ├── cli/                   # CLI commands
│   ├── api/                   # REST API
│   ├── notifications/         # Telegram + email
│   └── ingestion/             # Bulk import
├── ui/
│   └── dashboard.py           # Streamlit dashboard
├── scripts/
│   ├── setup_db.py            # Database setup
│   ├── backup.sh              # Automated backups
│   └── healthcheck.sh         # Health monitoring
├── tests/
│   └── test_core.py
├── docker-compose.yml         # Full stack
├── Dockerfile                 # App container
├── pyproject.toml             # CLI package
├── requirements.txt           # Python deps
└── README.md

______________________________________________________________________

🔌 源连接器

电报

from src.connectors.telegram import TelegramImporter

importer = TelegramImporter(
    export_file="telegram_export.json"
)
importer.import_all(db_conn)

WhatsApp

from src.connectors.whatsapp import WhatsAppImporter

importer = WhatsAppImporter(
    export_file="whatsapp_chat.txt"
)
importer.import_all(db_conn)

克劳德代码

from src.connectors.claude_code import ClaudeCodeImporter

importer = ClaudeCodeImporter(
    sessions_path="~/.claude/sessions"
)
importer.import_all(db_conn)

Gmail

from src.connectors.gmail import GmailImporter

importer = GmailImporter(
    takeout_path="./mail"
)
importer.import_all(db_conn)

______________________________________________________________________

📊 分析

趋势检测

自动检测:

  • 新兴话题 --标签比基线增加>50%
  • 拒绝话题 --标签下降>30%
  • 新实体 --首次出现的人/地点
  • 共现 --一起出现的主题

周报

每周日通过cron生成:

# Weekly Memory Report

### Activity
- New memories: 47
- By source: telegram: 23, claude: 15, manual: 9

### What's Hot
- ai: +200% (15 mentions)
- trading: +50% (8 mentions)

### Insights
- You're researching AI agents heavily this week
- Oliver appeared 5 times — significant collaboration

______________________________________________________________________

🔔 通知

电报警报

  • 新兴趋势
  • 周报
  • 内存统计摘要

电子邮件

  • 每日摘要
  • 周报
  • 异常警报

______________________________________________________________________

🐳 Docker服务

服务映像端口
postgrespgvector/pgvector:0.5.15432
apibenclawbot/开放式大脑8000
仪表板benclawbot/开放式大脑8501
mcpbenclawbot/开放大脑8080

______________________________________________________________________

🤖 手机安装(ARM)

在转换为Linux的旧Android手机上运行:

# Use ARM-compatible images
docker-compose -f docker-compose.arm.yml up -d

# Or build locally on phone
docker build --platform=linux/arm64 .

资源:约500MB RAM,约1GB存储空间

______________________________________________________________________

🧪 测试

# Run tests
pytest tests/

# Test MCP connection
python -c "from src.main import mcp; print(mcp)"

______________________________________________________________________

📝 许可证

麻省理工学院许可证——随心所欲。

______________________________________________________________________

🙏 致谢

______________________________________________________________________

🔗 链接

目录标签

目录标签

知识管理PythonClaude搜索本地部署语义搜索自动标注趋势分析MCP接口

支持客户端

Claude

接入字段

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

stdio

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

none

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdionone部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP