Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ personakit review # optional:
personakit list # see what is stored
personakit stats # counts only, never memory text
personakit serve # MCP server over stdio for your assistants
personakit forget <memory-id> # delete a memory and its quotes for good
```

`sweep`, `list` and `stats` also take `--json` for stable, sorted machine-readable output.
Expand Down Expand Up @@ -89,18 +90,13 @@ Your assistant gets two tools:

## How it works

```mermaid
flowchart LR
A[Claude Code / Codex sessions] --> B[ingest]
B -->|your own words only| C[extract]
C --> D[(local SQLite store)]
D --> E[review CLI, optional]
D --> F[MCP server]
F --> G[your assistants]
```
<p align="center">
<img src="docs/assets/how-it-works.svg" width="760" alt="How PersonaKit works: session files are read on your machine, only the turns you wrote go to the model you chose, memories are stored in a local SQLite file, and the MCP server serves approved and unconfirmed memories to your assistants">
</p>

1. **Ingest** reads local session files. Only the turns you wrote leave the parsing step.
2. **Extract** asks a model you already use (your own CLI login or API key) to propose memories.
2. **Extract** asks a model you already use, through your own signed-in `claude` or `codex` CLI,
to propose memories. The CLI runs with its tools off, in an empty temporary directory.
3. **Store** keeps each memory with its source quote, a state, and a scope.
4. **Review** is optional. Memories you never review are served marked *unconfirmed*; you
can approve, restrict, hide or forget any of them at any time.
Expand All @@ -115,6 +111,19 @@ A memory is always in one of four states:
| `restricted` | Never |
| `archived` | Never |

## Limits in 0.1

Stated plainly, so you know what you are installing:

- **Extraction is a model's guess.** Review is how you correct it.
- **Ranking is word overlap**, on whole words in Latin letters and digits. Questions and memories
in other scripts are not matched yet; approved memories are still returned as standing context.
- **A decision cannot be changed, only undone by forgetting.** `review` shows unconfirmed memories;
there is no command yet to edit a memory's wording or move a decided memory to another state.
- **A memory an assistant already received stays in that conversation.** Restricting it applies to
future reads.
- **Paste and credential detection is by shape**, not by meaning. Look before you share a store.

## What works today

| | Status |
Expand All @@ -126,6 +135,7 @@ A memory is always in one of four states:

## Documentation

- [personakit.me/docs](https://personakit.me/docs/): guides, concepts, and the MCP tools reference.
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): the design, module by module.
- [docs/PRIVACY.md](docs/PRIVACY.md): exactly what is sent where.
- [docs/ROADMAP.md](docs/ROADMAP.md): what exists and what is planned.
Expand Down
15 changes: 8 additions & 7 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ flowchart TB

| Module | Responsibility | Depends on |
|---|---|---|
| `model` | Plain data types: `Turn`, `Memory`, `Evidence`, `State`, `Scope`. No I/O. | nothing |
| `model` | Plain data types: `Turn`, `Session`, `Memory`, `Evidence`, `State`, `Decider`. No I/O. | nothing |
| `ingest/` | One adapter per source (`claude_code`, `codex`) plus `common` for the rules they share. Reads a session file, returns the owner's `Turn`s with a count of what was dropped and why. | `model` |
| `llm` | One interface, `complete(prompt) -> str`, with a CLI-backed and an API-backed implementation. Spend cap lives here. | nothing |
| `llm` | One interface, `complete(prompt) -> str`, implemented by two CLI-backed clients (`claude`, `codex`). The per-run call budget lives here. | nothing |
| `extract` | Builds the prompt from owner turns, validates the reply into `Memory` + `Evidence`, and counts what it rejects and why. | `model`, `llm` |
| `sweep` | Runs ingest, extract and store over new sessions. Skips unchanged files, stops only on budget or model error, never because unreviewed memories are piling up. | `ingest`, `extract`, `llm`, `store` |
| `retrieve` | The one read policy: approved and unconfirmed memories are served, restricted and archived never are. It also shapes the evidence quotes an assistant receives (email addresses masked, cut at a word boundary). Word-overlap ranking, a baseline to be measured. | `model` |
| `store` | The only module that touches SQLite. Schema, migrations, queries, state changes. | `model` |
| `review` | Terminal UI over the store: approve, edit, restrict, remove. Optional by design. | `store` |
| `review` | Terminal UI over the store: approve, restrict, hide, forget. Optional by design. | `store` |
| `mcp_server` | Two tools for assistants: `personakit_read` and `personakit_propose`. Holds no read-policy constants of its own. Assistants cannot approve, restrict, hide or forget; only the owner can, in `review`. | `store`, `retrieve`, `extract` |
| `stats` | Counts only (memories by state, sessions extracted, reads and how many returned something). Never content. | `store` |
| `cli` | Argument parsing and wiring; no logic. | all |
Expand All @@ -60,12 +60,13 @@ model, only `ingest` reads session files.** A second implementation of any of th

1. A memory with no evidence is not stored.
2. Unconfirmed memories are served, labelled as unconfirmed. Review is a quality tool, not a gate.
3. The system may merge duplicates and archive stale items (reversible). It never deletes or
widens a scope on its own.
3. The system never changes a memory's state or deletes a memory on its own. Extracting the same
statement again adds evidence to the existing memory and leaves your decision alone. Merging
near-duplicates and archiving stale items are planned for 0.2 and will be reversible.
4. Only text the owner wrote is sent to a model.
5. Statistics are counts, never content, and are local unless the owner chooses to share them.

## Out of scope for 0.1

Hosted service, accounts, sync, ChatGPT/Gemini/claude.ai import, embeddings, third-party name
detection, autonomous curation. Each is planned as an optional module; see the roadmap.
Hosted service, accounts, sync, ChatGPT/Gemini/claude.ai import and third-party name detection.
See the roadmap for what is planned.
12 changes: 9 additions & 3 deletions docs/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Privacy

<p align="center">
<img src="assets/data-boundary.svg" width="760" alt="What stays on your machine and what leaves it: only the turns you wrote go to the model you chose; assistants receive approved and unconfirmed memories with shortened, email-masked quotes and a count of withheld memories; nothing goes to PersonaKit">
</p>

- **Where data lives:** a SQLite file on your machine. Nothing is uploaded by PersonaKit.
- **What a model sees:** extraction sends only the turns *you* wrote, to the model you
configure (your own CLI login or API key), under that provider's terms. Assistant replies,
name, through your own signed-in `claude` or `codex` CLI, under that provider's terms. Assistant replies,
tool output and file contents from sessions are not sent.
- **What assistants see:** only what the MCP server returns, which respects each memory's
scope and state. The evidence quotes it returns are shortened to a word boundary and email
- **What assistants see:** only what the MCP server returns. Restricted and archived
memories are never returned; unconfirmed ones are labelled. The evidence quotes it returns are shortened to a word boundary and email
addresses in them are masked; the store itself keeps the quote as you wrote it.
- **Read log:** each read stores the time and two counts (returned, withheld) in your local
store. The question and the memory text are not recorded.
- **Statistics:** `personakit stats` prints counts to your terminal. It never includes memory text.
Sharing the output is your choice.
- **Deletion:** `personakit forget` removes a memory and its evidence from the store.
24 changes: 24 additions & 0 deletions docs/assets/data-boundary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/assets/how-it-works.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading