Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference

Synaptic is organized as a workspace of 18 focused crates (consolidated from 47 in v0.3). Each crate has its own API documentation generated from doc comments in the source code.

Crate Reference

CrateDescriptionDocs
synaptic-coreShared traits and types (ChatModel, Tool, Message, SynapticError, etc.)docs.rs
synaptic-modelsAll LLM providers (OpenAiChatModel, AnthropicChatModel, GeminiChatModel, OllamaChatModel, etc.) + ProviderBackend abstraction, ScriptedChatModel test double, wrappers (retry, rate limit, structured output, bound tools). Enable providers via feature flags: openai, anthropic, gemini, ollama, bedrock, coheredocs.rs
synaptic-integrationsLCEL composition (Runnable trait, BoxRunnable, pipe operator, parallel, branch, fallbacks, assign, pick), prompt templates, output parsers, callback handlers, session management, condenser strategies, secrets maskingdocs.rs
synaptic-toolsTool system (ToolRegistry, SerialToolExecutor, ParallelToolExecutor) + built-in tools: PDF loader (PdfLoader), Tavily search, SQL toolkit. Enable via feature flags: pdf, tavily, sqltoolkitdocs.rs
synaptic-memoryMemory strategies (buffer, window, summary, token buffer, summary buffer, RunnableWithMessageHistory)docs.rs
synaptic-graphGraph orchestration (StateGraph, CompiledGraph, ToolNode, create_react_agent, checkpointing, streaming)docs.rs
synaptic-storeKey-value store (InMemoryStore, FileStore) + persistent backends: PostgreSQL (PgStore, PgCache, PgCheckpointer), Redis (RedisStore, RedisCache, RedisCheckpointer), SQLite (SqliteCache, SqliteCheckpointer), MongoDB (MongoCheckpointer). Enable via feature flags: postgres, redis, sqlite, mongodbdocs.rs
synaptic-ragFull RAG pipeline: document loaders, text splitters, embeddings, vector stores (InMemoryVectorStore, VectorStoreRetriever, MultiVectorRetriever), retrievers (BM25, multi-query, ensemble, contextual compression, self-query, parent document) + vector store backends: Qdrant, Pinecone, Chroma, Elasticsearch, Weaviate, Milvus, OpenSearch, LanceDB, pgvector. Enable via feature flags: qdrant, pinecone, chroma, elasticsearch, weaviate, milvus, opensearch, lancedb, pgvectordocs.rs
synaptic-evalEvaluation framework (exact match, regex, JSON validity, embedding distance, LLM judge evaluators; Dataset and evaluate())docs.rs
synaptic-middlewareInterceptor trait, InterceptorChain, built-in middleware (model retry, circuit breaker, model fallback, tool retry, SSRF guard, summarization, human-in-the-loop approval, tool call limiting, security)docs.rs
synaptic-mcpModel Context Protocol adapters (MultiServerMcpClient, Stdio/SSE/HTTP transports)docs.rs
synaptic-macrosProcedural macros (#[tool], #[chain], #[entrypoint], #[task], #[traceable])docs.rs
synaptic-deepDeep Agent harness (Backend trait, filesystem tools, sub-agents, skills, create_deep_agent())docs.rs
synaptic-larkFeishu/Lark integration (document loaders, bot framework, Bitable checkpointer)docs.rs
synapticUnified facade crate that re-exports all sub-crates under a single namespacedocs.rs

Note: The docs.rs links above will become active once the crates are published to crates.io. In the meantime, generate local documentation as described below.

Local API Documentation

You can generate and browse the full API documentation locally with:

cargo doc --workspace --open

This builds rustdoc for every crate in the workspace and opens the result in your browser. The generated documentation includes all public types, traits, functions, and their doc comments.

To generate docs without opening the browser (useful in CI):

cargo doc --workspace --no-deps

Using the Facade Crate

If you prefer a single dependency instead of listing individual crates, use the synaptic facade:

[dependencies]
synaptic = "0.4"

Then import through the unified namespace:

use synaptic::core::Message;
use synaptic::openai::OpenAiChatModel;   // requires "openai" feature
use synaptic::models::ScriptedChatModel; // requires "model-utils" feature
use synaptic::graph::create_react_agent;
use synaptic::runnables::Runnable;