Persistent Knowledge System for AI-Assisted Development
"Thoth invents writing so that knowledge survives the death of the scribe."
Large Language Models have no persistent memory. Every conversation starts blank. When an AI assistant works on a codebase, it must re-read thousands of lines of source code to rebuild context β wasting tokens, time, and money. The reasoning behind decisions is lost between sessions.
This creates a cycle of re-discovery. The AI makes the same mistakes, asks the same questions, and rediscovers the same architecture every time it touches the project.
Thoth is a three-layer knowledge system that gives AI assistants structured memory across sessions:
| Layer | File | Purpose | Read When |
|---|---|---|---|
| π Memory | .thoth/memory.yaml |
Compressed project state (~100 lines) | Every session, first |
| π Journal | .thoth/journal.md |
Timestamped reasoning and insights | When WHY matters |
| π Artifacts | .thoth/artifacts/ |
Deep analysis, audits, benchmarks | On-demand by topic |
npx thoth-initAuto-detects your project language (Go, TypeScript, Python, Rust, Java), scans architecture, counts source lines, scaffolds .thoth/, and automatically injects Thoth into your AI coding tools β Cursor, Windsurf, Claude Code, Gemini, and Copilot.
No MCP server. No complex setup. Just a one-line rule that tells the AI: "read .thoth/memory.yaml first."
Non-interactive mode for CI/scripts:
npx thoth-init --yesmkdir -p .thoth/artifacts
touch .thoth/memory.yaml .thoth/journal.mdThen populate memory.yaml:
# π Thoth β Project Memory
# Read this FIRST before any source files.
## Identity
project: my-project
language: TypeScript
version: 1.0.0
## Architecture Quick Reference
# src/ β application source
# tests/ β test suite
# docs/ β documentation
## Critical Design Decisions
# 1. Next.js App Router for server components
# 2. Drizzle ORM for type-safe database access
## Known Limitations
# - No WebSocket support yet
# - OAuth only supports Google provider
## Recent Changes
# 2026-03-22: Initial Thoth setup
## File Map
# .thoth/memory.yaml β THIS FILE
# .thoth/journal.md β engineering journalBenchmarked across 4 real production codebases (428,000+ lines):
| Project | Source Lines | Thoth Lines | Reduction |
|---|---|---|---|
| sirsi-anubis (Go) | 14,589 | 85 | 99.4% |
| assiduous (React) | 160,897 | ~100 | 99.9% |
| FinalWishes (Next.js) | 96,514 | ~100 | 99.9% |
| SirsiNexusApp (TS) | 155,817 | ~100 | 99.9% |
| Total | 427,817 | ~385 | 99.9% |
In dollar terms (Claude Sonnet at ~$3/million tokens):
- Without Thoth: ~50,000 tokens per session start = $0.15/session
- With Thoth: ~1,000 tokens = $0.003/session
- 50Γ cost reduction on initial context loading
.thoth/memory.yaml
ββ Project identity, version, stats
ββ Architecture quick reference
ββ Critical design decisions (numbered, with rationale)
ββ Known limitations (what's broken, what's incomplete)
ββ Recent changes (most recent first)
ββ File map of important paths
β ~100 lines. Replaces reading 10,000+ lines of source.
.thoth/journal.md
ββ Timestamped decision entries
ββ Context that triggered each decision
ββ Alternatives considered
ββ Results and outcomes
ββ Meta-observations and patterns
β Running commentary. Institutional knowledge.
.thoth/artifacts/
ββ Benchmark results
ββ Platform audits
ββ Security reviews
ββ Design documents
ββ Historical walkthroughs
β Reference material. Read when diving deep.
thoth-init detects which tools you use and creates or updates the right rules file:
| Tool | File | What happens |
|---|---|---|
| Cursor | .cursorrules |
Created or appended |
| Windsurf | .windsurfrules |
Created or appended |
| Claude Code | CLAUDE.md + .agent/workflows/session-start.md |
Created or appended |
| Gemini | .gemini/style.md |
Created or appended |
| Copilot | .github/copilot-instructions.md |
Created or appended |
If the file already exists, Thoth appends its instruction. If it doesn't, Thoth creates it. If Thoth is already present, it skips. Idempotent and non-destructive.
For any AI tool that reads a rules or system prompt file, add this:
At the start of every conversation, read .thoth/memory.yaml before reading any source files.
This file is the project's compressed state (~100 lines) and replaces reading thousands of lines of code.
When reasoning matters, also read .thoth/journal.md for decision history.
After making significant changes, update both files.
When running with Sirsi Anubis, Thoth is also exposed as an MCP tool (thoth_read_memory). This is optional β the rules file approach above is simpler and works without any server.
Thoth is an independent, standalone tool β but it's part of a family of Egyptian-themed developer tools by Sirsi Technologies:
| Deity | Tool | Domain |
|---|---|---|
| π Thoth | sirsi-thoth | AI persistent memory β this repo |
| π Anubis | sirsi-anubis | Infrastructure hygiene β weigh, judge, purify |
| βοΈ Ra | coming via SirsiNexus | Enterprise fleet hygiene + policy enforcement |
Thoth works without Anubis. It's just files β YAML and Markdown. Any AI assistant that can read files can use Thoth. The Anubis MCP integration is a convenience layer, not a dependency.
- Memory is cheaper than re-discovery. 100 lines of structured YAML saves reading 10,000+ lines of source.
- Reasoning outlives the decision. The Journal captures WHY, not just WHAT.
- Depth on demand. Not every session needs benchmark data. Artifacts exist for when you need to go deep.
- The AI is the scribe. After every significant change, the AI updates Memory and writes a Journal entry.
- Human-readable, AI-optimized. YAML and Markdown β readable by both humans and LLMs. No proprietary formats.
- Zero dependencies. No CLI required. No server required. Just files in your repo.
MIT License β free and open source. Use Thoth in any project, commercial or otherwise.
Thoth was developed during the Sirsi Anubis project (March 2026) when AI assistants were spending ~80% of their context window re-reading unchanged source files. The three-layer system cut session startup context by 98%+ across 4 production codebases totaling 428,000 lines of code.
Named after the Egyptian god of knowledge, writing, and wisdom β the keeper of all records and inventor of hieroglyphics.
π Knowledge that survives the death of the scribe.