Local-first state graph for multi-agent orchestration.
elegant-STATE replaces manual state tracking (like STATE.adoc) with a queryable, event-sourced graph database. Multiple agents (Claude, Llama, custom modules) can query and modify the state via GraphQL.
| Feature | Description |
|---|---|
State Graph |
Nodes and edges with full event sourcing |
Full-Text Search |
Powered by tantivy |
Fuzzy Search |
agrep-like approximate matching (skim, nucleo) |
Document Conversion |
pandoc integration for any format |
OCR |
tesseract integration for image text extraction |
Multi-Agent Coordination |
Proposal mode, voting system, reputation tracking |
GraphQL API |
Query, mutation, and subscription support |
# Development shell (with Guix)
guix shell
# Build
cargo build --release
# Create a project
state-cli node create --kind project --content '{"name": "NeuroPhone"}'
# Create an insight
state-cli node create --kind insight --content '{"text": "Use sled for embedded storage"}'
# Link them
state-cli edge create --from <project-id> --to <insight-id> --kind part_of
# Start GraphQL server
state-cli serve http --port 4000git clone https://github.com/Hyperpolymath/elegant-STATE
cd elegant-STATE
cargo build --release
cp target/release/state-cli ~/.local/bin/Add to your ~/.config/guix/channels.scm:
(cons*
(channel
(name 'elegant-state)
(url "https://github.com/Hyperpolymath/elegant-STATE")
(branch "main"))
%default-channels)Then:
guix pull
guix install elegant-state# Node operations
state-cli node create --kind project --content '{"name": "MyProject"}'
state-cli node list --kind conversation --limit 10
state-cli node get <node-id>
state-cli node update <node-id> --content '{"status": "active"}'
state-cli node delete <node-id>
# Edge operations
state-cli edge create --from <id> --to <id> --kind references
state-cli edge list --from <id>
state-cli edge delete <edge-id>
# Search
state-cli search fulltext "NeuroPhone" --kinds project,insight
state-cli search fuzzy "nrophone" --limit 5
state-cli search agrep "neurophone" --max-errors 2
# Events
state-cli events --since "1 hour ago" --agent claude# Agent management
state-cli agent list --reputation
state-cli agent set claude --mode proposal --vote-weight 0.8
# Proposals
state-cli proposal list --pending
state-cli proposal create create "new:insight" --payload '{"text": "idea"}' --rationale "Found this"
state-cli vote <proposal-id> approve --reason "Looks good"# Get nodes
query {
nodes(kind: PROJECT) {
id
content
createdAt
}
}
# Search
query {
search(query: "NeuroPhone", kinds: [PROJECT, INSIGHT]) {
id
kind
content
}
}
# Get neighbors
query {
neighbors(id: "01ABC...", depth: 2) {
id
kind
}
}# Create a node
mutation {
createNode(input: {
kind: INSIGHT
content: {text: "hello"}
}, agent: CLAUDE) {
id
}
}
# Create an edge
mutation {
createEdge(input: {
from: "01ABC..."
to: "01DEF..."
kind: REFERENCES
}) {
id
}
}elegant-STATE uses Nickel for type-safe, composable configuration.
# Generate config for environment
just config dev
just config prod
# Generate all permutations
just config-matrixelegant-STATE/ ├── src/ │ ├── schema/ # StateNode, StateEdge, StateEvent │ ├── store/ │ │ ├── sled_store.rs # Core sled backend │ │ ├── fulltext.rs # tantivy full-text search │ │ ├── fuzzy.rs # agrep-like matching │ │ ├── pandoc.rs # document conversion │ │ └── ocr.rs # tesseract OCR │ ├── coordinator/ │ │ ├── capabilities # Direct/Proposal/Observer modes │ │ ├── proposal # mutation proposals │ │ ├── voting # multi-strategy voting │ │ └── reputation # agent reputation tracking │ ├── graphql/ │ │ ├── query │ │ ├── mutation │ │ └── subscription │ └── cli/ ├── config/ # Nickel configuration ├── guix/ # Guix channel └── doc/ # Documentation
| StateNode |
Vertices in the knowledge graph (conversations, projects, insights, tasks) |
| StateEdge |
Relationships between nodes (references, derived_from, part_of, etc.) |
| StateEvent |
Append-only changelog of all mutations |
# Using just
just build # Debug build
just build-release # Release build
just test # Run tests
just lint # Run lints
just doc # Generate docs
# Using cargo directly
cargo build --release
cargo test
cargo clippySee CONTRIBUTING.adoc for guidelines.
MIT - see LICENSE.txt