๐ฎ asobi
A persistent, project-local knowledge graph CLI for LLM agents.
Keep memory, track session state, and share context across conversations โ stored in a local, single-file libSQL/SQLite database.
โจ Features
- Knowledge graph โ entities, append-only (capped) observations, and directed relations.
- Truths โ durable
keyโvaluefacts per entity for current state (status,version); status-as-truth makes a board a singlesearch --where status=โฆ. - Fast search โ
searchover libSQL FTS5 (BM25 relevance, porter stemming) with a substring fallback, plus--where key=valuetruth filters (the query term is optional). - Concurrency-safe โ WAL-mode storage with bounded startup and write retries, so lead and dispatched agents can share a graph.
- Pluggable backend โ libSQL is the default; an experimental Turso backend is opt-in behind
--features turso-experimentaland keeps its own isolated state file. - Lazy reads โ
graph/searchreturn truths + counts;showreturns the full body. Cheap to load, cheap on tokens. - Skills โ install reusable agent instructions from a git repo or local path.
- Document tier (optional,
--features documents) โingest+ semanticqueryover Markdown.
๐ฆ Installation
From crates.io (recommended)
# with the optional document tier (semantic ingest + query):
Prebuilt binary (cargo-binstall)
No compile โ cargo-binstall pulls the binary from the GitHub release:
From source
Or build locally with make build (graph CLI) or make build-documents (adds ingest/query/compact). Requires Rust 1.85+, Edition 2024.
๐ Quick Start
# Store and recall context (names are hierarchical, e.g. ame:mobile-support:task-1)
๐ป Common Commands
asobi graph/search <q>/search --where status=READY/show <name>... --expand part_of --with-idsโ read the graph (supports subtree expansions and sequential observation IDs).asobi new <name> <type> --obs "..."/obs <name> "..."/update-obs <name> <old/id> <new> [--id]/rm-obs <name> <content/id> [--id]โ manage observations (supports updates and deletions by unique sequential IDs).asobi truth <name> <key> <value>/rm-truth <name> <key>/history <name> [key]โ manage truths and read their change history (overwrites are archived with valid-time; history is opt-in and never shown ingraph/search/show).asobi skills install <src> --all/update/skills/skills show <name>โ manage skills (--allandupdatesync, pruning skills dropped upstream;--selectis additive).asobi stats/export -o graph.json/import graph.json/resetโ inspect & manage.asobi backup/restore <snapshot> [--force]โ full-fidelity libSQL snapshots; see the usage guide.
๐ Sandboxed Environments
When running in sandboxed or restricted environments (such as Codex, Nix build sandboxes, or containerized runners), use a project-local workspace (asobi init --local) or configure custom database paths (ASOBI_HOME, ASOBI_DATABASE_URL). The storage backend manages WAL coordination and retry behavior; legacy journal-mode and busy-timeout overrides are not supported.
See the Running in Sandboxed Environments section in the Usage Guide for more details.
๐ ๏ธ Development
- Task runner:
make(Nix-wrapped).make checkis the quality gate: rustfmt, Prettier, Ruff, Clippy with-D warnings, graph tests, document-feature tests, and both CLI verification scripts. - Rust quality standard: keep code rustfmt-clean, introduce no Clippy warnings, preserve single-threaded test isolation, and add regression coverage for behavior changes. Run
make checkbefore commits. - Coverage: with
cargo-tarpaulininstalled, runcargo tarpaulin --all-features --out Html --output-dir coverageand opencoverage/index.html. - Benchmarks: run
make bench; use performance profiling for Criterion baselines, DHAT allocations, and SQL plans. - See
docs/usage.mdfor the full CLI reference,docs/workflow.mdfor the day-to-day and task dispatcher workflow, anddocs/architecture.mdfor design.