The Loom of
Structured Intelligence.
Weaver is built on a foundation of explicit state and semantic fusion. It treats code not just as text, but as a queryable, structured fabric of logic.
System Topology
The Weaver architecture separates the ephemeral nature of CLI commands from the persistent state of the analysis daemon. This split ensures speed for user interactions while maintaining deep, semantic context in the background.
- CLI Client (Ephemeral)
- Weaver Daemon (Persistent)
- LSP / Tree-sitter Integrations
Semantic Fusion Engine
The heart of Weaver is the Fusion Engine. It ingests raw code, syntax-tree data, and LSP diagnostics to build the internal semantic structures behind every read, query, and change command.
Multi-Source Ingestion
Combines static analysis (Tree-sitter) with dynamic runtime data (LSP) to resolve references that static analysis misses.
Provenance Tagging
Every piece of data carries a provenance trail. We know exactly why the AI thinks a function is relevant.
"type": "semantic_node",
"id": "fn::process_data",
"provenance": {
"source": "tree-sitter-rust",
"confidence": 0.98
},
"relationships": [
"calls::validate_input",
"uses::DataStruct"
]
}
Figure 3.1: Internal fusion telemetry, not the public CLI and daemon JSONL envelope.
Client–Daemon Model
Decoupling the user interface from the intelligence engine allows for persistent context and faster CLI response times.
The Daemon
- Hosts LSP child processes (rust-analyzer, pyrefly lsp, etc.).
- Dispatches JSONL requests from the CLI and streams responses.
- Uses a Unix domain socket by default on Unix; the prototype retains loopback-only TCP for non-Unix compatibility.
- Auto-starts when a domain command is issued — no manual launch needed.
$ weaver daemon start
The Client
-
Parses config (
--config-path, XDG, env vars) and CLI flags. - Sends JSONL requests to the daemon, streams the response.
-
Renders readable output on a TTY;
--jsonis the one switch to the stable machine contract.
$ weaver definitions get --uri file:///src/main.rs --position 10:5
One Daemon, Many Workspaces
One local, per-user weaverd serves every repository. Each request carries a workspace locator; the daemon – never the client – canonicalizes it into the key that owns caches, language servers, and the mutation coordinator. A client path is untrusted input, not filesystem authority.
Isolated by identity
Language servers are keyed by their full execution identity: language, command, resolved toolchain, and workspace roots. Unrelated repositories never share a process, and a missing rustup component returns structured installation guidance rather than a silent fallback.
Concurrent by default
No daemon-wide mutex. Unrelated workspaces and languages progress in parallel under bounded admission at daemon, workspace, and server scope. Saturation returns a structured, retryable overload result naming the scope and the wait – not a dropped connection.
Local and quiet
Single-user and local-only: no remotely reachable endpoint or remote authentication. The prototype's loopback-only TCP compatibility path does not turn the planned per-user model into a network service. Logs and metrics carry bounded, opaque workspace identifiers – never raw paths, environment values, source contents, or patch bodies.
Data Flow & Provenance
Weaver ensures that every insight provided to the AI agent can be traced back to a source of truth.
Ingestion & Parsing
When a file is observed, the Daemon invokes Tree-sitter to generate a Concrete Syntax Tree (CST).
Sempai Pattern Matching
The Sempai Engine runs structural queries against the CST to identify high-level constructs (functions, classes, API endpoints).
LSP Enrichment
If available, the Language Server is queried for type definitions, references, and documentation, enriching the static nodes with semantic context.
Graph Fusion
All data points merge into the semantic graph. Every node carries its evidence: an LSP-confirmed edge outranks a purely syntactic one, and the provenance says which is which.
Explore the Toolkit
Now that you understand the architecture, see how to wield it.