KnowledgeKeeper

KnowledgeKeeper

A GitOps pipeline that syncs Slack and Notion decisions into a versioned wiki, served to AI coding tools via MCP with tools to browse knowledge maps, read concepts, and audit changes.

Category
访问服务器

README

KnowledgeKeeper

Every fact your AI knows has a git commit hash on it.

KnowledgeKeeper is a local-first, open-source GitOps pipeline that turns your team's Slack messages and Notion pages into a versioned knowledge wiki — automatically served to AI coding tools via MCP.


The Problem

AI coding assistants (Claude Code, Cursor, Copilot) are only as good as the context they receive. Your team makes decisions in Slack threads and Notion pages all day — but none of that ever makes it into your AI's context window. The result: Claude suggests a deprecated API endpoint. Cursor still thinks you're using the old database. Nobody updated the rules file after the migration.

This is not an AI problem. It's a context maintenance problem.


How It Works

Slack / Notion / Jira
        │
        ▼
┌───────────────────────────────────────────────────────────────────┐
│  STAGE A  Full Pull + Triage                                      │
│  Pulls everything since last sync — no keyword filtering.        │
│  Hard filter removes bots, duplicates, short messages.           │
└──────────────────────────┬────────────────────────────────────────┘
                           │
                           ▼
┌───────────────────────────────────────────────────────────────────┐
│  STAGE B  Batch LLM Signal Detection                              │
│  1 LLM call per 25 messages. Detects: decisions, policies,       │
│  architecture choices, metrics, risks.                           │
└──────────────────────────┬────────────────────────────────────────┘
                           │
                           ▼
┌───────────────────────────────────────────────────────────────────┐
│  STAGE C  Wiki Reconciliation                                     │
│  Maps each signal against your existing wiki. Classifies as:     │
│  NEW · UPDATE · SUPPLEMENT · CONTRADICT                          │
└──────────────────────────┬────────────────────────────────────────┘
                           │
                           ▼
┌───────────────────────────────────────────────────────────────────┐
│  STAGE D  Compile to Staging Branch                               │
│  Writes structured OKF Markdown files to a git staging branch.  │
│  Assigns review lanes: AUTO · QUICK · ATTN                       │
└──────────────────────────┬────────────────────────────────────────┘
                           │
                           ▼
┌───────────────────────────────────────────────────────────────────┐
│  STAGE E  Human Review Digest  (Streamlit UI)                    │
│  Reviewer approves proposals in under 10 minutes.                │
│  Approved content merges to main with a git commit hash.         │
└──────────────────────────┬────────────────────────────────────────┘
                           │
                           ▼
         MCP Server — serves wiki to Claude Code, Cursor, Windsurf

Key Features

Feature Detail
Full-coverage pull Pulls everything since last sync — no missed decisions from bad search queries
Wiki reconciliation AI maps new signals against existing knowledge before asking a human
Three-lane review AUTO (high confidence) · QUICK (one-click) · ATTN (contradictions)
Git audit trail Every approved fact has a commit hash, reviewer name, and timestamp
OKF compliance Implements Google Cloud's Open Knowledge Format (Apache 2.0, June 2026)
MCP serving One server for Claude Code, Cursor, Windsurf, and all MCP-compatible IDEs
Local-first Runs entirely on your machine. Zero data egress with Ollama.
Connector adapters Pluggable source adapters — all produce a common RawItem stream

Tech Stack

Layer Technology
LLM Integration Pydantic AI — structured JSON extraction with auto-retry
Git Operations GitPython — staging branch, merge, revert
MCP Server FastMCP — 3 tools served to AI IDEs
Review UI Streamlit — three-lane digest with undo
Scheduler APScheduler — nightly pipeline + morning notify
Source Connectors slack-sdk · notion-client
State Store SQLite (stdlib) — sync timestamps and run health
CLI Click + Rich
Default LLM qwen3:4b via Ollama (local) · Claude Haiku 4.5 (cloud option)

Project Structure

knowledgekeeper/
├── cli.py                  # Guided setup wizard + start/status commands
├── config.py               # Config dataclass, load/save YAML
├── connectors/
│   ├── base.py             # RawItem dataclass + ConnectorBase ABC
│   ├── slack_connector.py  # Full channel history pull
│   ├── notion_connector.py # Database page pull
│   └── triage.py           # Dedup + length + bot filter
├── pipeline/
│   ├── detector.py         # Stage B: batch LLM signal detection
│   ├── reconciler.py       # Stage C: wiki reconciliation (Pydantic AI)
│   ├── aggregator.py       # Merge proposals for same concept
│   ├── compiler.py         # Stage D: write to staging branch
│   └── runner.py           # Orchestrate A → B → C → D
├── okf/
│   ├── schema.py           # OKFConcept dataclass + frontmatter parse/render
│   ├── index_builder.py    # Rebuild index.md files
│   └── log_writer.py       # Append to audit log
├── git_ops/
│   └── manager.py          # Staging branch, merge, revert, read
├── digest/
│   └── ui.py               # Streamlit review UI (Proposals · Status · Settings)
├── mcp/
│   └── server.py           # FastMCP: get_knowledge_map, read_concept, get_changes
├── db/
│   └── store.py            # SQLite: sync state + run history
└── scheduler.py            # Nightly 22:00 pipeline + 08:00 notify

Quick Start

# 1. Install
git clone https://github.com/YOUR_USERNAME/knowledgekeeper
cd knowledgekeeper
python3 -m venv venv && source venv/bin/activate
pip install -e .

# 2. Pull the local LLM (or skip and use Anthropic)
ollama pull qwen3:4b

# 3. Guided setup — connects Slack + Notion, initialises wiki repo
knowledgekeeper init

# 4. Open the review digest
python3 -m streamlit run knowledgekeeper/digest/ui.py --server.port 8080

# 5. Start the nightly scheduler
knowledgekeeper start

Run the full pipeline once without waiting for the scheduler:

python3 demo/run_pipeline.py

Run the happy-path test with synthetic data (no real credentials needed):

python3 scripts/run_test.py

MCP Integration

Add this to your Claude Code or Cursor MCP config:

{
  "mcpServers": {
    "knowledgekeeper": {
      "command": "python3",
      "args": ["-m", "knowledgekeeper.mcp.server"]
    }
  }
}

Your AI now has three tools:

  • get_knowledge_map — returns the root index of all approved concepts
  • read_concept(path) — reads a specific OKF file on demand
  • get_changes(since?) — returns the audit log

The OKF Wiki Output

Every approved proposal becomes a structured Markdown file:

---
type: concept.decision
title: Supabase as Primary Database
domain: architecture
confidence: high
proposal_type: NEW
source_refs:
  - author: alex.chen
    channel: engineering
    platform: slack
approved_by: Sarah Okafor
git_commit: a1b2c3d
---

## Decision

The team selected Supabase as the primary database after evaluating
Supabase, Firebase, and PlanetScale...

With a root index and audit log:

~/my-wiki/
├── index.md          ← knowledge map (what MCP reads first)
├── log.md            ← full audit trail with commit hashes
└── okf/
    ├── architecture/ ← index.md + concept files
    ├── product/
    └── operations/

Test Coverage

58 tests across all pipeline stages and components:

pytest tests/ -v
# 58 passed in 3.2s
tests/
├── test_config.py           test_git_manager.py
├── test_store.py            test_index_builder.py
├── test_slack_connector.py  test_index_scanner.py
├── test_notion_connector.py test_okf_schema.py
├── test_triage.py           test_okf_writer.py
├── test_detector.py         test_compiler.py
├── test_reconciler.py       test_runner.py
├── test_aggregator.py       test_scheduler.py
├── test_digest_ui.py        test_mcp_server.py

Key Design Decisions

Full pull over keyword search — Stage A pulls everything since last sync. A keyword search misses decisions phrased in ways we didn't anticipate. The LLM in Stage B is cheap enough that filtering happens there, not at the query layer.

Wiki reconciliation before human review — The AI does the cognitive work of mapping new information against existing knowledge. The human makes a binary judgment on a structured proposal — not a raw Slack message.

Git as the knowledge store — Proposals land on a kk-staging branch. Approval merges to main. Every fact is traceable: git log --oneline okf/architecture/auth-api.md shows every time that concept was modified and who approved it.

Connector adapter pattern — All sources implement ConnectorBase and produce list[RawItem]. The pipeline from Stage B onwards is source-agnostic. Adding Jira or Linear requires one new file in connectors/.

No LangChain, no LlamaIndex — Pydantic AI for structured LLM calls. GitPython for git. FastMCP for serving. Everything else is stdlib Python.


Roadmap

  • [x] Slack + Notion connectors
  • [x] 5-stage pipeline (triage → detect → reconcile → compile → review)
  • [x] Streamlit digest UI with three review lanes
  • [x] MCP server (Claude Code, Cursor, Windsurf)
  • [x] Guided CLI setup wizard with live token validation
  • [x] Settings tab in Streamlit UI
  • [x] OKF-compliant wiki structure (index.md + log.md)
  • [ ] Jira connector
  • [ ] PyPI package release
  • [ ] OAuth web flow for Slack + Notion setup
  • [ ] Cost dashboard

License

Apache 2.0 — use it, fork it, build on it.


Built as an AI PM portfolio project. If you're solving context drift on your team, I'd love to hear from you.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选