Personal Intelligence System
Captures AI-assisted work into a searchable ledger and exposes it via MCP for querying past conversations and decisions.
README
Personal Intelligence System
A self-hosted, conversation-first knowledge ledger. It continuously captures your AI-assisted work — Claude Code sessions, claude.ai chats, uploaded documents, GitHub activity — into an immutable event ledger, and makes all of it searchable (keyword + semantic) from anywhere: your terminal, claude.ai on the web, or your phone.
The core idea: your most valuable knowledge isn't in your file system — it's in your conversations. This system treats every AI conversation as a first-class, permanent, queryable record.

What it does
- Captures automatically. A Claude Code
Stophook records every coding turn (prompt, response, tools used, files changed, git context) seconds after it happens. On claude.ai, Claude itself writes to the ledger through MCP tools (kb_capture_note,kb_capture_document). - Ingests your history. Importers for Claude Code transcripts, claude.ai account exports, and ChatGPT account exports — including text extracted from documents you uploaded into chats. Every import is idempotent: re-running adds only what's new.
- Remembers documents. PDFs, DOCX, and text files are stored content-addressed in S3, chunked, embedded, and linked to the conversations that referenced them.
- Finds things by meaning. Hybrid retrieval: PostgreSQL full-text search and pgvector cosine similarity, fused with reciprocal rank fusion. A paraphrase finds the conversation even when no keywords match.
- Answers from anywhere. An OAuth-protected MCP server exposes the ledger to claude.ai (web, desktop, mobile) as a custom connector, so you can ask "what did I decide about X last month?" from your phone.
- Links code to conversations. GitHub push webhooks connect commits back to the Claude Code session that produced them.
Architecture in one paragraph
Every capture becomes an immutable event (unique content hash, database trigger blocks UPDATE/DELETE). Normalizers project events into queryable tables — conversations, messages, turns, documents — that can be dropped and rebuilt from the ledger at any time. Policy (deny-lists, secret scanning) runs server-side on every write; secrets are additionally redacted client-side before upload. Retrieval layers exact match, full-text, and vector search over the projections. The MCP layer is a thin adapter: every tool wraps a retrieval or ingestion function 1:1.
Read the full walkthrough in docs/ARCHITECTURE.md.
Stack
Python 3.12 · FastAPI · PostgreSQL 16 + pgvector · SQLAlchemy 2 + Alembic · MCP Python SDK · AWS (App Runner, RDS, S3, Secrets Manager, Bedrock via CDK) · pytest (107 tests)
Runs for roughly $40/month on AWS, or entirely locally with Docker.
Quick start (local)
docker compose up -d postgres # pgvector-enabled Postgres
uv sync
uv run alembic upgrade head
uv run pytest -q # 107 tests
uv run python -m pis.api # API on 127.0.0.1:8800
Deploy to AWS
cd infra && npm install
CDK_DEFAULT_ACCOUNT=<your-account> npx cdk deploy # RDS, S3, secrets, roles, Bedrock endpoint
./scripts/create-service.sh # App Runner service
The container migrates the database at boot and serves the API + MCP
endpoint. Subsequent code changes: npx cdk deploy && ./scripts/update-service.sh.
Connect claude.ai
- Settings → Connectors → Add custom connector →
https://<service-url>/mcp - Approve with your passcode (generated in Secrets Manager at deploy).
- Chat naturally: "search my ledger for …", "log this decision", "save this document".
The server implements OAuth 2.1 with dynamic client registration and PKCE, so no client IDs or secrets are ever pasted around.
Capture your history
# Claude Code transcripts (local JSONL)
uv run pis import run ~/.claude/projects --api-url $URL --token $TOKEN
# claude.ai account export (Settings → Privacy → Export data)
uv run pis import run export.zip --adapter claude-export --api-url $URL --token $TOKEN
# ChatGPT account export
uv run pis import run export.zip --adapter chatgpt-export --api-url $URL --token $TOKEN
# Documents from folders
uv run pis artifacts scan ~/Documents --api-url $URL --token $TOKEN
Live capture: integrations/claude-code/install-daemon.sh installs a
launchd daemon and the Stop hook wiring; every future Claude Code turn lands
in the ledger automatically.
Security model
- Ledger immutability enforced by the database, not convention.
- All personal data lives in your Postgres/S3 — never in this repo.
- Secret scanning both client-side (redact) and server-side (reject + audit).
- Deny-lists for repositories/paths that must never be captured.
- MCP and API are bearer/OAuth-gated; the consent screen is passcode-locked.
- Capture is fail-open for your tools (a dead daemon can never block Claude Code) and fail-closed for data (unauthenticated writes are impossible).
Status & roadmap
Working today: capture (Claude Code + claude.ai), historical import, hybrid semantic search, document ingestion, MCP connector, session↔commit linking, LLM memory extraction (conversations distilled into typed propositions with evidence, supersession and dedup), topic context packs, auto-extraction scheduler, and session-start context injection into Claude Code.
Next: curation workflow (promoting memories to user-confirmed), artifact binary resolution, golden retrieval evaluations, isolated finance vault.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.