destenson/opencaw

Rust

0

483 commits

updated Jun 18, 2026

See the code

README

OpenCAW — Context as Workspace

A Rust library for thinking-trace-driven context management in LLM applications. OpenCAW treats context as a managed workspace: documents are indexed as lightweight stubs, and full content is recalled inline as the model reasons about it — multiplying effective context by 1–2 orders of magnitude at flat compute cost.

This is not another RAG wrapper. The differentiator is thinking-trace-as-retrieval-signal: the model's own reasoning drives what gets loaded, evicted, and consolidated, rather than a retrieval step that runs before inference.

Why this exists

Watch a coding agent work on an unfamiliar codebase: it burns call after call grepping and reading files just to reconstruct facts that were on disk the whole time — a function's signature, a trait's bounds, the fields of a struct, where something is called from. Each fact is fetched piecemeal, used once, and then falls out of context, so the next related question pays the same tax again. The information was available; it just wasn't resident when the model needed it.

That repeated "tool-call to find on-disk content" loop is the problem OpenCAW exists to remove. Instead of the model going out to fetch content, the content comes to the model: the corpus is indexed as lightweight stubs, and the model's own reasoning trace — "I need the ModelAdapter Send bound", "what fields does PrebuiltIndex have" — is the signal that pulls the right full content into the workspace and evicts what's no longer relevant. The aim is a context window that stays full of what the current reasoning step actually needs, over a corpus far larger than the window, at roughly flat compute cost.

See docs/origin.md for the founding design and docs/scope.md for what is in and out of scope for v0.1.

Quick Start

cargo build --workspace
cargo run -p caw-cli          # Ollama + recall loop, interactive
cargo test --workspace        # includes end-to-end integration test (no API keys needed)

See docs/getting-started.md for adapter setup, environment variables, and a minimal code example.

Documentation

Full index with status for every doc: docs/README.md.

GlossaryCanonical definitions for every term used in the project
ArchitectureCrates, data flow, design principles
Getting StartedBuild, run, environment variables, code example
AdaptersAnthropic, Groq, Ollama, OpenAI-compat, LlamaCpp, Mock
Embedding ProvidersFastEmbed, API, Candle, ONNX
StorageSQLite, Qdrant, HNSW, hybrid retrieval
BenchmarkingNIAH, opencaw, sysdoc workloads; sweep harness; intent bench
OriginFrozen origin document: founding design, stub-and-recall architecture, eviction policy, curation
Scopev0.1 deliverables, what's in and out, scope change protocol
BugsOpen bug log
Codebase ReviewFrozen snapshot (2026-05-09): implementation status, structural gaps, debt inventory

Development tracking is in TODO.md.

Contributors

destenson

483 commits

destenson/opencaw

Rust

0

483 commits

updated Jun 18, 2026

See the code

README

OpenCAW — Context as Workspace

A Rust library for thinking-trace-driven context management in LLM applications. OpenCAW treats context as a managed workspace: documents are indexed as lightweight stubs, and full content is recalled inline as the model reasons about it — multiplying effective context by 1–2 orders of magnitude at flat compute cost.

This is not another RAG wrapper. The differentiator is thinking-trace-as-retrieval-signal: the model's own reasoning drives what gets loaded, evicted, and consolidated, rather than a retrieval step that runs before inference.

Why this exists

Watch a coding agent work on an unfamiliar codebase: it burns call after call grepping and reading files just to reconstruct facts that were on disk the whole time — a function's signature, a trait's bounds, the fields of a struct, where something is called from. Each fact is fetched piecemeal, used once, and then falls out of context, so the next related question pays the same tax again. The information was available; it just wasn't resident when the model needed it.

That repeated "tool-call to find on-disk content" loop is the problem OpenCAW exists to remove. Instead of the model going out to fetch content, the content comes to the model: the corpus is indexed as lightweight stubs, and the model's own reasoning trace — "I need the ModelAdapter Send bound", "what fields does PrebuiltIndex have" — is the signal that pulls the right full content into the workspace and evicts what's no longer relevant. The aim is a context window that stays full of what the current reasoning step actually needs, over a corpus far larger than the window, at roughly flat compute cost.

See docs/origin.md for the founding design and docs/scope.md for what is in and out of scope for v0.1.

Quick Start

cargo build --workspace
cargo run -p caw-cli          # Ollama + recall loop, interactive
cargo test --workspace        # includes end-to-end integration test (no API keys needed)

See docs/getting-started.md for adapter setup, environment variables, and a minimal code example.

Documentation

Full index with status for every doc: docs/README.md.

GlossaryCanonical definitions for every term used in the project
ArchitectureCrates, data flow, design principles
Getting StartedBuild, run, environment variables, code example
AdaptersAnthropic, Groq, Ollama, OpenAI-compat, LlamaCpp, Mock
Embedding ProvidersFastEmbed, API, Candle, ONNX
StorageSQLite, Qdrant, HNSW, hybrid retrieval
BenchmarkingNIAH, opencaw, sysdoc workloads; sweep harness; intent bench
OriginFrozen origin document: founding design, stub-and-recall architecture, eviction policy, curation
Scopev0.1 deliverables, what's in and out, scope change protocol
BugsOpen bug log
Codebase ReviewFrozen snapshot (2026-05-09): implementation status, structural gaps, debt inventory

Development tracking is in TODO.md.

Contributors

destenson

483 commits

Languages

Rust

95.7%

Shell

2.7%

Python

1.6%