GitKB Documentation

GitKB is a local-first knowledge graph for Markdown documents and source code. Create a document, check it out, edit it, commit the change, and sync the documents you need with a remote.

Document history is tracked per document. A commit can change several documents, and each change points to the prior commit for that document. You can hold a small subset of a knowledge base without cloning every document or its unrelated history.

How it fits together

You and your agentsCLI, Desktop and MCPLocal GitKB daemonYour knowledge baseCode intelligenceYour codeYour team's remote
flowchart
  • Documents: specs, tasks, decisions and the rest are Markdown files with a little frontmatter, linked to each other and to your code.
  • History: every change is a commit, so you can see who changed what, when and why, and return to any version.
  • Agents: any agent that can use a CLI or MCP reads and writes the same knowledge you do.
  • Daemon: a local GitKB daemon keeps your knowledge base and code index current, and serves both to the CLI, Desktop and MCP. See Daemon.
  • Code intelligence: GitKB indexes your code, so you and your agents can see callers, call paths and the reach of a change.
  • Sharing: push to a remote when your team needs it, pull the slices you select, and check out only the documents you need.

Local work and collaboration

Everything works locally and offline, with no account or server. When your team needs it, push to a remote, on GitKB.com or your own infrastructure, pull the slices you select, and check out only what you need. Knowledge keeps its own history, separate from your code’s Git history, so document edits never clutter code diffs.

Optional local embeddings add semantic search across documents and code.

Quick overview

Documents

Everything in GitKB is a document with YAML frontmatter and Markdown content:

yaml
---
slug: tasks/my-feature
title: "Add user authentication"
type: task
status: active
tags: [feature, auth]
---

## Overview
What this task accomplishes and why it exists.

## Acceptance Criteria
- [ ] JWT-based auth flow
- [ ] Session management
- [ ] Tests passing

Documents have types (task, spec, incident, note, context), statuses, tags, and relationships to other documents via [[wikilinks]].

The knowledge graph

Documents link to each other through wikilinks, frontmatter references, and code symbols — forming a knowledge graph you can query:

shell
git-kb graph tasks/my-feature --direction both

MCP integration

Connect GitKB to your editor and AI assistants gain full access:

json
{
  "mcpServers": {
    "gitkb": {
      "command": "git-kb",
      "args": ["mcp"]
    }
  }
}

The first store-backed tool call connects to the daemon and starts it if needed. MCP initialization and tool discovery can complete before the daemon starts.

Next steps