synwire: The Umbrella Crate

synwire is Synwire's convenience re-export crate. It aggregates commonly used types from across the workspace into a single dependency, so application authors can write synwire = "0.1" in their Cargo.toml and get started without tracking individual crate versions.

When to use synwire

Use synwire when you are building an end-user application --- a CLI agent, a web service that calls LLMs, a RAG pipeline. It re-exports synwire-core and provides ready-made implementations for patterns that most applications need.

If you are writing a library crate (a custom vector store, an LLM provider, an embedding backend), depend on synwire-core instead. This keeps your dependency footprint minimal and avoids pulling in implementations your users may not need.

What it provides

Beyond re-exporting synwire_core as core, the crate ships several modules of its own:

ModulePurpose
agent::preludeGlob-importable set of agent types: Agent, AgentNode, Runner, Directive, Session, AgentEvent, Usage
cacheMoka-backed embedding cache --- wraps any Embeddings impl and deduplicates repeated queries
chat_historyChat message history traits and implementations for managing conversation context windows
promptsFew-shot prompt templates and example selectors
text_splittersText splitter implementations for chunking documents before embedding
output_parsersAdditional output parsers beyond those in synwire-core

Conditional modules

Several heavyweight integrations are gated behind feature flags so they impose zero cost when unused:

ModuleFeatureRe-exports
sandboxsandboxsynwire-sandbox --- process isolation, SandboxedAgent::with_sandbox(), ProcessPlugin
lsplspsynwire-lsp --- LspPlugin, LanguageServerRegistry, go-to-definition, hover, diagnostics
dapdapsynwire-dap --- DapPlugin, DebugAdapterRegistry, breakpoints, stepping, variable inspection

Agent prelude

The agent::prelude module is designed for glob import:

#![allow(unused)]
fn main() {
use synwire::agent::prelude::*;

// Now you have Agent, AgentNode, Runner, Directive, DirectiveResult,
// AgentError, Session, SessionManager, AgentEvent, Usage, etc.
}

This avoids long import lists when writing agent application code while keeping the individual types traceable (they all originate in synwire-core::agents).

Feature flags

FlagEnables
openaisynwire-llm-openai (not re-exported as a module, but available as a dependency)
ollamasynwire-llm-ollama
sandboxsynwire-sandbox + the sandbox module
lspsynwire-lsp + the lsp module
dapsynwire-dap + the dap module

No features are enabled by default. A minimal synwire dependency pulls in only synwire-core, moka, serde, serde_json, regex, and tokio.

Dependencies

CrateRole
synwire-coreAlways present --- trait definitions and shared types
mokaConcurrent cache for the embedding cache module
serde / serde_jsonSerialization for prompt templates and output parsers
regexText splitter pattern matching
tokioAsync runtime
tracingObservability

Ecosystem position

Application code
    |
    v
synwire  (re-exports + utilities)
    |
    +-- synwire-core        (traits, shared types)
    +-- synwire-llm-openai  (optional)
    +-- synwire-llm-ollama  (optional)
    +-- synwire-sandbox     (optional)
    +-- synwire-lsp         (optional)
    +-- synwire-dap         (optional)

synwire sits at the top of the dependency graph. It is the recommended entry point for applications but is never depended on by other workspace crates.

See also