loading…
Search for a command to run...
loading…
Auto-captures decision context from multi-agent workflows to preserve the 'why' behind every choice. Enables task traceability, reasoning retrieval, and continu
Auto-captures decision context from multi-agent workflows to preserve the 'why' behind every choice. Enables task traceability, reasoning retrieval, and continuous improvement across planning and implementation sessions.
Decision intelligence for multi-agent workflows
⸻
🚨 The Problem: Context Evaporates
Multi-agent development is fast—but context gets lost at every handoff: • Planning sessions → compressed into short GitHub issues • Architecture debates → collapsed into one-line directives in Cursor • Implementation agents → see what to do, not why
Result: Tasks move quickly, but decisions lose their reasoning. Context exists somewhere—it just doesn't travel.
⸻
✅ The Solution: Auto-Captured Decision Context
Personal KG preserves the "why" behind every decision—automatically, without extra work.
Captured context includes: • Full reasoning chains • Alternatives considered + rejected • Constraints & trade-offs that shaped choices • Idea evolution across planning sessions • Nuanced context beyond specs
⸻
🔁 The Learning Loop
Personal KG isn't just storage—it's a continuous improvement engine: • Accountability → Every directive is traceable to its reasoning • Auditability → Agent actions are explainable and reviewable • Reflection & Analysis → See what worked, what failed, and improve continuously
⸻
🌊 Impact: From Compressed Tasks to Full Context
Before Personal KG • Stripped-down tasks • Fragmented context • Agents move fast but blind
After Personal KG • Tasks + reasoning, constraints, and alternatives • Rich context flows seamlessly across tools • Agents move fast with full understanding
⸻
👉 Personal KG = Never lose the why. Capture it once, use it everywhere.
The Personal KG MCP server is available as an NPM package:
npm install @tomschell/personal-kg-mcp
.cursor/mcp.json or your MCP client configuration:{
"mcpServers": {
"personal-kg-mcp": {
"command": "node",
"args": [
"node_modules/@tomschell/personal-kg-mcp/dist/server.js"
],
"cwd": "/path/to/your/project",
"env": {
"PKG_STORAGE_DIR": ".kg",
"PKG_AUTO_BACKUP_MINUTES": "0",
"PKG_USE_ANN": "true",
"PKG_GITHUB_INTEGRATION_ENABLED": "true",
"PKG_MCP_CAPTURE_ENABLED": "true",
"PKG_MCP_CAPTURE_TOOLS": "github",
"PKG_MCP_CAPTURE_EXCLUDE": "",
"PKG_MCP_CAPTURE_AUTO": "true"
}
}
}
}
Set up GitHub Integration (optional):
.env file: PKG_GITHUB_TOKEN=github_pat_your_token_hereRestart your MCP client (Cursor, Claude Desktop, etc.)
⚠️ Important: MCP servers are only loaded at session startup. After adding or modifying the MCP configuration, you must restart your Claude Code, Cursor, or Claude Desktop session for the tools to become available. Simply saving the config file is not enough.
| Environment Variable | Default | Description |
|---|---|---|
PKG_STORAGE_DIR |
.kg |
Directory for storing knowledge graph data |
PKG_AUTO_BACKUP_MINUTES |
0 |
Auto-backup interval (0 = disabled) |
PKG_USE_ANN |
true |
Use approximate nearest neighbor search |
PKG_GITHUB_INTEGRATION_ENABLED |
false |
Enable GitHub issue/PR integration |
PKG_MCP_CAPTURE_ENABLED |
true |
Auto-capture MCP tool calls |
PKG_MCP_CAPTURE_TOOLS |
github |
Tools to capture (comma-separated) |
PKG_MCP_CAPTURE_EXCLUDE |
"" |
Tools to exclude (comma-separated) |
PKG_MCP_CAPTURE_AUTO |
true |
Auto-capture without explicit calls |
OPENAI_API_KEY |
- | OpenAI API key for semantic embeddings |
PKG_EMBEDDING_MODEL |
text-embedding-3-small |
OpenAI embedding model |
For a complete list of environment variables, see .env.example.
Setup Options:
Conductor Workspaces (recommended for 1Password users):
./scripts/setup-conductor.sh
This creates symlinks to your 1Password-managed environment files.
Manual Setup:
cp .env.example .env
# Edit .env with your values
MCP Config: Add environment variables directly to your MCP configuration (see above).
npm install @tomschell/personal-kg-mcp
.cursor/mcp.json:{
"mcpServers": {
"personal-kg-mcp": {
"command": "node",
"args": [
"node_modules/@tomschell/personal-kg-mcp/dist/server.js"
],
"cwd": "/path/to/your/project",
"env": {
"PKG_STORAGE_DIR": ".kg",
"PKG_AUTO_BACKUP_MINUTES": "0",
"PKG_USE_ANN": "true",
"PKG_GITHUB_INTEGRATION_ENABLED": "true",
"PKG_MCP_CAPTURE_ENABLED": "true",
"PKG_MCP_CAPTURE_TOOLS": "github",
"PKG_MCP_CAPTURE_EXCLUDE": "",
"PKG_MCP_CAPTURE_AUTO": "true"
}
}
}
}
Set up GitHub Integration (optional):
.env file: PKG_GITHUB_TOKEN=github_pat_your_token_hereRestart your MCP client (Cursor, Claude Desktop, etc.)
Start with these essential tools:
| Purpose | Tool |
|---|---|
| Session warmup | kg_session_warmup |
| Capture decisions/progress | kg_capture |
| Session summaries | kg_capture_session |
| Search | kg_search (mode: semantic) |
| Project overview | kg_get_project_state |
| Get context | kg_get_relevant_context |
| Track questions | kg_open_questions |
| Link nodes | kg_edges (operation: create) |
The Personal KG MCP server is configured through environment variables set in .cursor/mcp.json.
PKG_STORAGE_DIR
.kg"PKG_STORAGE_DIR": "data/knowledge/personal"PKG_GITHUB_INTEGRATION_ENABLED
false (disabled by default for security)"true" or "false"PKG_GITHUB_TOKEN to be set to actually enablePKG_GITHUB_TOKEN
.env file, not in version controlPKG_MCP_CAPTURE_ENABLED
truePKG_MCP_CAPTURE_TOOLS
"github""PKG_MCP_CAPTURE_TOOLS": "obsidian,notion,github"PKG_MCP_CAPTURE_EXCLUDE
"" (empty)PKG_MCP_CAPTURE_AUTO
"true"{
"mcpServers": {
"personal-kg-mcp": {
"command": "node",
"args": [
"node_modules/@tomschell/personal-kg-mcp/dist/server.js"
],
"cwd": "/path/to/your/project",
"env": {
"PKG_STORAGE_DIR": ".kg",
"PKG_AUTO_BACKUP_MINUTES": "0",
"PKG_USE_ANN": "true",
"PKG_GITHUB_INTEGRATION_ENABLED": "true",
"PKG_MCP_CAPTURE_ENABLED": "true",
"PKG_MCP_CAPTURE_TOOLS": "github",
"PKG_MCP_CAPTURE_EXCLUDE": "",
"PKG_MCP_CAPTURE_AUTO": "true"
}
}
}
}
proj:<name>, ws:<workstream>, ticket:<id>proj:kg ws:kg-dev ticket:78Important for Developers: The kg_session_warmup tool includes an agentTrainingReminders field. These reminders are NOT user-facing documentation - they are designed to train AI agents on proper development workflows during coding sessions.
Purpose:
Who sees this:
Users benefit from these reminders indirectly through improved agent behavior, not by reading them directly.
next_actions[]).| Tool | Args (required bold) | Notes |
|---|---|---|
| kg_capture | content, type, tags?, project?, workstream?, ticket?, importance?, visibility?, includeGit?, auto_link?, sessionId? | Primary knowledge creation |
| kg_capture_session | summary, duration?, artifacts?, next_actions[], visibility?, importance? | Session summaries |
| kg_link_session | sessionId, nodeId | Link session to node |
| kg_update_node | id, content?, tags?, importance?, visibility? | Update existing nodes |
| Tool | Args | Notes |
|---|---|---|
| kg_search | query, mode∈text|semantic|time_range, tags?, type?, limit?, threshold? | Unified search |
| kg_query_context | topic | Summarize topic-relevant nodes |
| kg_get_relevant_context | query, project?, max_items?, include_questions? | Proactive context injection |
| kg_get_project_state | project | Overview, blockers, decisions |
| kg_session_warmup | project?, workstream?, limit?, discover? | Session context warmup |
| kg_list_tags | prefix?, minCount?, limit? | List all tags with counts |
| Tool | Args | Notes |
|---|---|---|
| kg_node | operation∈get|delete|find_similar, id, deleteEdges?, limit?, threshold? | Unified node ops |
| Tool | Args | Notes |
|---|---|---|
| kg_edges | operation∈create|list|maintain, fromNodeId?, toNodeId?, relation?, nodeId?, maintainOp? | Unified edge ops |
| Tool | Args | Notes |
|---|---|---|
| kg_open_questions | project?, include_stale?, limit? | List unresolved questions |
| kg_resolve_question | question_id, resolved_by_id, resolution_note? | Mark question resolved |
| Tool | Args | Notes |
|---|---|---|
| kg_admin | operation∈health|backup|validate|repair|export|import|rename_tag|merge_tags, ... | Unified admin ops |
| Tool | Args | Notes |
|---|---|---|
| kg_analyze | operation∈clusters|emerging|path|graph_export, limit?, threshold?, startId?, endId? | Unified analysis ops |
| Relation | When to use | Example |
|---|---|---|
| references | Loose citation / mention | Session note references design doc |
| relates_to | General topical overlap | Two progress nodes on same feature |
| derived_from | Work or idea builds on another | Refactor derived_from original design decision |
| blocks | Hard dependency ordering | Bug fix blocks release task |
| duplicates | Identical or redundant content | Duplicate question captured twice |
kg_session_warmup({ project: "my-project" }) (discovery mode if no project)kg_get_relevant_context({ query: "topic" }) for backgroundkg_capture decisions, progress, insights, questionskg_open_questions to see unresolved itemskg_edges({ operation: "create", ... })kg_capture_session with summary and next_actionsAdd these instructions to your project's CLAUDE.md to enable automatic knowledge graph usage:
## Knowledge Graph
This project uses personal-kg-mcp for decision tracking and context management.
### Session Start
- Run `kg_session_warmup` with project name at the start of each session
- Use discovery mode (no project) to see all available projects
### During Work
- Capture important decisions with `kg_capture` (type: "decision")
- Log progress on features with `kg_capture` (type: "progress")
- Record insights and learnings with `kg_capture` (type: "insight")
- Track open questions with `kg_capture` (type: "question")
### Context Retrieval
- Use `kg_get_relevant_context` before starting work on a topic
- Check `kg_open_questions` for unresolved items
- Use `kg_query_context` for topic summaries
### Session End
- Summarize work with `kg_capture_session`
- Include `next_actions` for continuity
For projects using personal-kg-mcp, add to your CLAUDE.md:
## Knowledge Graph
- **MCP Server**: personal-kg-mcp
- **Storage**: `.kg/` (gitignored)
- **Usage**: Capture decisions, track questions, maintain context across sessions
- **Session Start**: Always run `kg_session_warmup` with project name
- **Key Tools**: kg_capture, kg_session_warmup, kg_get_relevant_context, kg_open_questions
{
"tool": "kg_session_warmup",
"args": { "project": "kg", "limit": 20 }
}
{
"tool": "kg_capture",
"args": {
"content": "Progress: added query tools for Issue 64",
"type": "progress",
"sessionId": "<sessionId>",
"tags": ["proj:kg", "ws:kg-dev", "ticket:64"],
"importance": "medium"
}
}
{
"tool": "kg_capture_session",
"args": {
"summary": "Completed KG tool analysis and documentation updates",
"next_actions": ["Implement simplified system prompt", "Update .cursorrules"],
"artifacts": ["Issue #215", "Updated documentation"]
}
}
{
"tool": "kg_edges",
"args": {
"operation": "create",
"fromNodeId": "<decisionId>",
"toNodeId": "<taskId>",
"relation": "blocks"
}
}
{
"tool": "kg_query_context",
"args": { "topic": "CI/CD pipeline improvements" }
}
Tools have been consolidated for easier use:
| Tool | Operations | Description |
|---|---|---|
kg_analyze |
clusters, emerging, path, graph_export | Analysis operations |
kg_admin |
health, backup, validate, repair, export, import, rename_tag, merge_tags | Admin/maintenance |
kg_edges |
create, list, maintain | Relationship management |
kg_node |
get, delete, find_similar | Node operations |
kg_search |
text, semantic, time_range | Unified search |
kg_open_questions - Track unresolved questions with staleness detectionkg_resolve_question - Mark questions as resolvedkg_get_relevant_context - Proactive context injection for queriescd packages/personal-kg-mcp
npm install
npm run build
npm test
npm run test:unit
npm test -- config.test.ts --run
npm run dev
MIT License - see LICENSE file for details.
Выполни в терминале:
claude mcp add personal-kg-mcp -- npx Read and write pages in your workspace
автор: NotionIssues, cycles, triage — from Claude
автор: LinearSearch and read your Drive files
автор: GoogleConnect and unify data across various platforms and databases with [MindsDB as a single MCP server](https://docs.mindsdb.com/mcp/overview).
автор: mindsdbНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории productivity