Metadata-Version: 2.4
Name: lexicon-kb
Version: 0.3.1
Summary: Lexicon engine: local Markdown knowledge base for agents
Author: not-so-fat
License: MIT
Project-URL: Homepage, https://github.com/not-so-fat/lexicon
Project-URL: Repository, https://github.com/not-so-fat/lexicon
Project-URL: Changelog, https://github.com/not-so-fat/lexicon/blob/main/CHANGELOG.md
Keywords: knowledge-base,markdown,agents,notes,search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Documentation
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Lexicon

**Knowledge base with AI agents, especially for dynamic knowledge**

We come across a lot of knowledge through different activities.

- Work with AI agents
- Our own notes
- Messages
- Meetings and chats
- URLs we or our friends are interested in

Our AI agents should help us organize this knowledge, and they should get much stronger with it.
Especially when we want to clone ourselves as agents, this knowledge is critical input for them to work.

The key insight comes from [Zettelkasten](https://zettelkasten.de/overview/), a knowledge management methodology.

## Principles

- Dump any data (missing data is more costly).
- Split source data (the dump) and curated data (for long-term search).
- Search curated data first. Go back to the source when we need more detail or missed something.
- Manage knowledge as statements. A statement is one claim or observation we can understand and check on its own.
- Organize statements into different areas. An area is a named domain of knowledge, such as a project or a recurring subject.

Memory = Knowledge (facts about the world) + Operational insights (how to work, records, state, rules). Across agents, share knowledge in Lexicon and how-to-work in Agent Deck playbooks. Everything else stays per-agent. Lexicon is the local Markdown knowledge base. Agent state, operating rules, and work tracking live outside it.

## Solution Idea

1. Data is dumped into the `Sources/` directory.
   - Meeting transcripts
   - Notes by humans and agents
   - Clips from websites
   - Agent chats
2. Facts are accumulated in append-only `Evidence/`.
   - Project decisions
   - People
3. Periodically, the owner reviews important decisions and adds, modifies, or deletes entries in `Synthesis/`.
   - Directions
   - Objectives

## Key structure

| Layer | Path | Purpose |
| --- | --- | --- |
| Sources | `Sources/Chats/`, `Sources/Ideas/`, `Sources/Meetings/`, `Sources/Transcripts/`, `Sources/Clippings/` | Keep raw agent chats, ideas to review, meeting notes, transcripts, and web clippings. |
| Evidence | `Evidence/<area>/` | Append dated statements with links to their sources. Record corrections as new statements. |
| Synthesis | `Synthesis/<area>.md`, `Synthesis/Direction/<area>.md`, `Synthesis/Objectives.md`, `Synthesis/Objectives.evidence.md`, and supporting notes | Maintain current understanding, directions, and objectives with links to evidence. |
| Metadata | `Metadata/pending/<id>.json` | Track triage approval items and outcomes in private Git. |
| Metadata | `Metadata/recap/<area>/YYYY-MM.md` | Track monthly triage recaps by area in private Git. |
| Metadata | `Metadata/review/YYYY-Www.md` | Track periodic objectives reviews by ISO week in private Git. |

Direction and Objectives are Synthesis notes. The owner reviews them, and edits default to `require_approval`. Metadata supports triage and sits outside the knowledge tiers. The three Metadata paths above are Git-tracked. Per-machine diagnostics and the QMD index live in the local user cache outside the vault.

## Sync

Lexicon syncs the vault through private Git on a timer, even when Obsidian is closed. Captures and other engine writes sync immediately. Manual edits can take up to one timer interval to sync. If you use Obsidian, turn off the Git plugin's automatic commit, push, and pull, or remove it. Leave Obsidian Sync and other folder sync services disabled for this vault.

## Install

```bash
curl -fsSL https://raw.githubusercontent.com/not-so-fat/lexicon/main/install.sh | sh -s -- --vault <your-private-vault-git-url> --path "$HOME/vault"
```

See [Setup](docs/SETUP.md) for requirements, new vaults, and upgrades.

## Commands

The engine CLI covers the whole loop: `lexicon setup`, `lexicon doctor`, `lexicon init`, `lexicon capture`, `lexicon search`, `lexicon read`, `lexicon triage`, `lexicon lint`, `lexicon sync`, `lexicon index`, `lexicon info`, `lexicon mcp`, `lexicon fetch`, `lexicon fireflies`, `lexicon hidock`, and `lexicon guide`. Start hand-written notes from a packaged template with `lexicon template <kind>` (`lexicon template --list` lists the seven kinds); follow a packaged workflow with `lexicon guide <name>` (`process_meeting`, `triage_area`, `weekly_review`); templates and guides are served by the engine and never copied into the vault.

## More details

See [the redesign spec](docs/DESIGN.md) for the engine, search, and triage. [Setup](docs/SETUP.md) covers installing the engine and running your first triage pass; [Updating](docs/UPDATING.md) covers engine upgrades; [Memory model](docs/MEMORY_MODEL.md) covers the tiers and lint rules; [Objectives](docs/OBJECTIVES.md) covers the review ritual. [Publishing](docs/PUBLISHING.md) covers cutting a release, and the [Changelog](CHANGELOG.md) lists what changed. [Adapters](adapters/README.md) are optional harness-side pointers into the engine.

[MIT license](LICENSE).
