elstongun / leviathan
git clone https://github.com/elstongun/leviathan.git
v0.2.0 · 11d ago
Deep memory for agents over large datasets. Leviathan is a single static binary that turns your records (JSONL, JSON, CSV/TSV, SQLite, or anything a database CLI can export) into a ranked full-text index.
—
stars, 24h
—
stars, 7 days
+841
stars, 30 days · #359
841
★ total
50
forks · 14 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageRust
LicenseApache-2.0
Created2026-10-05 (15d ago)
Last push1d ago
Watchers2
OwnerUser
Links
README excerpt
Deep memory for agents over large datasets. Index any table, export or log once; your agent gets the few records that answer the question. Leviathan is a single binary that turns records (JSONL, JSON, CSV/TSV, SQLite, or any database CLI's output) into a ranked full-text index. Agents ask in plain words and get short, cited result cards: ~450 tokens per answer at any dataset size, instead of grepping and reading raw history. | At 1M records (678 MB) | Leviathan | best grep strategy | |---|---:|---:| | Median tokens per question | **436** | 107,122 (245×) | | Relevant record returned | **99.0%** top 5 · 98.5% rank 1 | 96.0% within a 30K-char output | | Worst case (1,200 questions) | **602 tokens** | 9.7M tokens | | Median latency | **33 ms** | 92 ms | Measured on a synthetic maintenance log (one example dataset; nothing in Leviathan is specific to it). Methodology, all six scales and caveats: docs/BENCHMARKS.md. ## Quickstart [code] [code] - `-g` accepts a key, name or partial name. Ambiguous or unknown groups list candidates and exit 3, never guess. - No match in the group falls back to other groups, labeled `OTHER CUSTOMER`. - Combine `--where field=value`, `--since`/`--until`, `"phrases"` and `-exclusions`. Prebuilt binaries are on Releases. No runtime dependencies; the index is one SQLite file. ## Map your data Fields are paths (`a.b`, `items[].name`); only `id` is required. | Field | Enables | |---|---| | `id` | `get`, `upsert`, `delete`, citations | | `title` / `text` | Card headline (weighted 2×) / searched text (default: all strings) | | `group` / `group_name` | `-g` scoped search, name resolution, labeled fallback | | `date` | `--since`, `--until`, `recent` | | `filters` / `display` | `--where` facets / fields shown on cards | | `empty_values` / `rank.boost` | Placeholders treated as missing / favor complete records | [code] Any database works through its own CLI; Leviathan never holds credentials: [code] Builds are atomic and skipped when nothing changed; `upsert` and `delete` keep an index fresh. Full reference: docs/CONFIG.md. ## Plug it into your agent **CLI + skill (recommended):** any agent with a shell can call it. Copy `skills/leviathan` into `~/.claude/skills/` or paste it into `AGENTS.md` / `.cursor/rules`. Costs 0 tokens until used. `skills/leviathan-memory` does the same for memory. **MCP (optional):** `leviathan mcp` serves four read-only stdio tools (`search`, `resolve_group`, `get`, `describe`) whose descriptions include a summary of your dataset (~640 tokens per session). `leviathan wrap ` prints the config for 24 agents (Claude Code, Codex, Cursor, VS Code / Copilot, Gemini CLI, Windsurf, Cline, Zed, JetBrains and more) and `--apply` writes it; `leviathan wrap` lists them all (docs/AGENTS.md). **Remote (optional):** `leviathan serve --http` serves the same tools as Streamable HTTP MCP, REST and OpenAPI, with a bearer token or OAuth 2.1, so claude.ai, ChatGPT, the Anthropic and OpenAI APIs and agent frameworks ca