# kgai. Shared decision memory for AI dev teams.

kgai is an immutable, local-first memory of your team's engineering decisions for Claude Code. It ships as a Claude Code plugin and a `kg` CLI. Decisions are captured automatically as you work and recalled before the AI edits code. Open source, MIT.

- **Canonical URL.** https://kgai.dev/
- **Source repo.** https://github.com/kgaidev/kgai (MIT, version 1.5.2, Linux and macOS)
- **Contact.** team@kgai.dev

Install (the only step there is):

```
claude plugin marketplace add kgaidev/kgai
claude plugin install kgai@kgai-marketplace
```

From here it runs on its own. Capture and recall are automatic.

More from kgai.dev:

- Machine summary: https://kgai.dev/llms.txt
- Notes (blog): https://kgai.dev/blog/
- Technical reports: https://kgai.dev/papers/
- Comparison with mem0, Graphiti and Cognee: https://kgai.dev/compare
- Star on GitHub: https://github.com/kgaidev/kgai

On this page: Why, Example, How it works, Team sync, Numbers, Compare, Cloud, GitHub.

## Overview

A Claude Code plugin and a kg CLI. Open source, MIT.

kgai records the why behind your code as you work. What changed, what was rejected, what replaced what. Any teammate's agent reads it before touching that area. No wiki to write, nothing to maintain.

Local-first, no server, no account. Nothing is ever overwritten. Team sync over an S3 bucket you own.

How sharing works, in one picture: Alice and her agent, Bob and his agent, and a new teammate on day one each hold the whole graph locally on their own machine. There is no direct path between them and no re-explaining. Alice's machine records the why into a bucket the team owns (`s3://team-bucket`, append-only, one shard per writer). Bob's agent recalls from that bucket before editing. The new teammate pulls the whole history from the same bucket. No central server sits in the path.

## 01. What a team gets

**Three things stop happening.**

**Dead ends stop coming back.** The approach you ruled out in March is not re-proposed in July. Rejected paths stay in the memory with the reason they failed, and an agent sees them before it suggests anything.

**"Why is it like this?" stops costing an afternoon.** QA files a bug that was a decision. Review turns up two conflicting answers. The recorded reason settles it in seconds, without interrupting whoever decided.

**Knowledge stops leaving with people.** A new teammate syncs and their agent starts with the team's whole decision history, not an empty memory. When someone leaves, the why stays.

## 02. The example

**One decision, two machines, four months.**

### Monday, Alice's machine

Alice's agent moves payment retries off exponential backoff. As the work finishes, the plugin records why:

```
element    payment-retry
decision   retries run on a fixed 30-second schedule
why        the provider rate-limits burst retries. Exponential backoff
           tripped the limiter in staging.
rejected   exponential backoff. The retry storm after an outage hits
           the rate limit
```

### Thursday, Bob's machine

Sync ran in the background. Before Bob's agent touches the retry code, it reads:

> **What Bob's agent sees.** Retries are on a fixed 30-second schedule. Exponential backoff was rejected in June: the provider rate-limits burst retries.

So it does not propose backoff again.

### September, either machine

The provider lifts the limit and the team switches back. Nothing is edited. A new decision supersedes:

```
$ kg history payment-retry
May    retry with exponential backoff                           superseded
June   fixed 30-second schedule, provider rate-limits bursts    superseded
Sept   exponential backoff, the provider lifted the limit       in force
```

## 03. How it works

**Three verbs, no upkeep.**

**A. Capture.** While you work with Claude Code, the plugin records structural decisions on its own: what changed, why, what was rejected. Trivial edits record nothing.

**B. Recall.** Before the agent edits an area, it reads the decisions that shaped that area, not the whole history. A `kg` CLI answers the same questions outside Claude Code.

**C. Supersede.** A change of mind is a new decision that supersedes the old one. Nothing is edited in place, so "what did we believe in June" is a query, not archaeology.

## 04. Team sync

**Syncs like version control, without the merge conflicts.**

Every decision is an immutable, content-addressed event in a per-writer shard. Two teammates, or ten agents, recording in parallel **cannot produce a textual conflict**. There is nothing to merge. Each machine replays the shared log into the same graph, deterministically.

The bucket is yours. Any S3-compatible store works, MinIO and R2 included. No server of ours in the path. And when two people genuinely decide the same thing two ways, it surfaces as a **branch** you resolve by recording one more decision.

The diagram on the page shows it: Alice appends to shard a, Bob to shard b, and any agent to its own shard, all inside one append-only `s3://team-bucket`. Out of that bucket every machine replays the same graph. One writer per shard, write-once objects. Same log, same graph, on every machine.

## 05. Measured, not promised

**One million decisions, thirty writers.**

- 1,000,000 decisions in one store
- 30 writers' shards
- ~100 ms decision lookup

That figure is the decision lookup specifically. Recall and free-text search are slower. The benchmark method and raw runs are in the repository.

## 06. Where next

**Compare it, read the source, or go hosted.**

- **Compare.** How kgai relates to mem0, Graphiti and Cognee, including what they do better than we do. https://kgai.dev/compare
- **Source.** MIT licensed. Prebuilt binaries for Linux and macOS. On Windows it runs inside WSL. https://github.com/kgaidev/kgai
- **Cloud beta.** A hosted sync plane, the graph in your browser, and an MCP endpoint for agents beyond Claude Code. Local-first stays free forever. Write to team@kgai.dev.

## Questions and answers

### What is kgai?

kgai is shared decision memory for AI dev teams. It captures the engineering decisions behind your code, what changed, why, and even the alternatives you rejected, into immutable, searchable memory that your AI reads before changing code and writes to afterward.

### What problem does kgai solve?

In AI-assisted, team-based development the reasoning behind code lives in people's heads and lost chat threads. AI sessions start from zero and re-decide or contradict past choices. kgai keeps that reasoning as durable shared memory so nobody, human or AI, re-litigates or re-walks decisions the team already made.

### Does kgai run locally?

Yes. kgai is local-first: reads and writes run on your machine and are instant and offline. Syncing the decision log with your team over an S3 bucket you own is optional and happens only when you choose.

### What does kgai do, in short?

- Immutable decision memory for AI coding agents
- AI reads relevant decisions before changing code and writes new ones after
- Remembers rejected decisions and dead ends, not just what shipped
- Local-first: reads and writes run on your machine, sync is optional
- Measured at 1M decisions with ~100 ms decision lookups
- Conflict-free team sync over an S3 bucket you own

## Stop re-deciding. Start remembering.

Install. The only step there is.

```
claude plugin marketplace add kgaidev/kgai
claude plugin install kgai@kgai-marketplace
```

Star on GitHub: https://github.com/kgaidev/kgai

---

kgai, an immutable memory of engineering decisions. Notes: https://kgai.dev/blog/ · Papers: https://kgai.dev/papers/ · GitHub: https://github.com/kgaidev/kgai · team@kgai.dev · MIT

This page was written and built with AI assistance.
