Skip to main content

Crate dci_tool

Crate dci_tool 

Source
Expand description

§dci-tool — Direct Corpus Interaction

A sandboxed, ripgrep-backed corpus-interaction toolset and agent for cyber-focused LLM agents, built on rig.

Instead of embedding a corpus into a vector database, a DCI agent interrogates the raw text directly with a small set of bounded, strongly-typed commands — search, find, read, list — that run ripgrep’s own engine in-process. This trades opaque semantic recall for transparent, reproducible, real-time evidence with path:line citations.

§Layers

§Example

use dci_tool::{CorpusRoot, DciAgent};
let corpus = CorpusRoot::new("/path/to/corpus")?;
let agent = DciAgent::builder(model, corpus).build();
let answer = agent.investigate("Which host first contacted 10.0.0.5?").await?;
println!("{answer}");

Re-exports§

pub use agent::DEFAULT_MAX_TURNS;
pub use agent::DEFAULT_PREAMBLE;
pub use agent::DciAgent;
pub use agent::DciAgentBuilder;
pub use error::DciError;
pub use error::Result;
pub use sandbox::CorpusRoot;
pub use sandbox::Limits;
pub use session::InvestigationState;
pub use session::InvestigationTurn;
pub use session::SessionConfig;
pub use session::SessionStore;
pub use tools::CorpusTools;
pub use tools::FindTool;
pub use tools::ListTool;
pub use tools::ReadTool;
pub use tools::SearchTool;

Modules§

agent
The Direct Corpus Interaction agent: a rig Agent pre-wired with the four corpus tools and a preamble that teaches the search → narrow → read → cite investigation loop.
engine
The in-process corpus engine.
error
Error types for the Direct Corpus Interaction (DCI) toolset.
sandbox
Sandboxing primitives: a read-only path-jail rooted at a single corpus directory, plus the resource limits that bound every operation.
session
Per-session investigation state.
telemetry
Telemetry helpers for DCI.
tools
Discrete, typed corpus-interaction tools exposed to a rig Agent.