Skip to main content

Crate smooth_operator

Crate smooth_operator 

Source
Expand description

§smooth-operator

The reference core for smooth-operator — the service layer on top of smooth_operator_core (the agent engine). It defines three things:

  • domain — storage-agnostic domain structs (Conversation, Participant, Message, Session) that mirror spec/domain/*.json. Checkpoints re-use the engine’s smooth_operator_core::Checkpoint.
  • adapter — the single StorageAdapter seam every backend implements (see docs/STORAGE.md). Its checkpoint/knowledge accessors return smooth-operator-core’s own traits so the engine plugs straight in.
  • runtime — a minimal AgentRuntime that constructs a real smooth-operator Agent and Workflow, proving consumption.

It also owns two shared retrieval seams both backends/consumers depend on: embedding (the text→vector Embedder + the network-free DeterministicEmbedder, the one home for both the Postgres adapter and the ingestion pipeline) and rerank (the optional post-retrieval Reranker stage — feature gap G8).

Re-exports§

pub use access_control::AccessContext;
pub use access_control::AclKnowledgeStore;
pub use access_control::DocAcl;
pub use adapter::ConversationUpdate;
pub use adapter::MessagePage;
pub use adapter::MessageQuery;
pub use adapter::SessionUpdate;
pub use adapter::StorageAdapter;
pub use auth::AuthConfig;
pub use auth::AuthError;
pub use auth::AuthVerifier;
pub use auth::JwtVerifier;
pub use auth::NoAuthVerifier;
pub use auth::Principal;
pub use auth::Role;
pub use auth::SmooIdentityVerifier;
pub use connector_config::ConnectorConfig;
pub use connector_config::ConnectorConfigStore;
pub use connector_config::ConnectorKind;
pub use connector_config::InMemoryConnectorConfigStore;
pub use curation::with_boost;
pub use curation::with_document_set;
pub use curation::CuratedKnowledgeStore;
pub use curation::DocMeta;
pub use curation::RetrievalFilter;
pub use curation::DEFAULT_BOOST;
pub use domain::Citation;
pub use domain::ContentItem;
pub use domain::Conversation;
pub use domain::Direction;
pub use domain::Message;
pub use domain::MessageContent;
pub use domain::Participant;
pub use domain::ParticipantRef;
pub use domain::ParticipantType;
pub use domain::Platform;
pub use domain::Session;
pub use domain::SessionStatus;
pub use domain::CITATION_SNIPPET_MAX_CHARS;
pub use embedding::cosine_similarity;
pub use embedding::DeterministicEmbedder;
pub use embedding::Embedder;
pub use embedding::InputType;
pub use embedding::DEFAULT_EMBEDDING_DIM;
pub use gateway_key::resolve_gateway_key;
pub use gateway_key::EnvGatewayKeyResolver;
pub use gateway_key::GatewayKeyResolver;
pub use rerank::apply_optional_rerank;
pub use rerank::LexicalReranker;
pub use rerank::NoopReranker;
pub use rerank::Reranker;
pub use runtime::AgentRuntime;
pub use runtime::KnowledgeChatRuntime;
pub use runtime::SharedRuntime;
pub use runtime::TurnOutcome;
pub use runtime::TurnState;
pub use runtime::MAX_CITATIONS;
pub use settings::AgentSettings;
pub use settings::InMemorySettingsStore;
pub use settings::SettingsStore;
pub use settings::DEFAULT_MODEL;
pub use settings::DEFAULT_SYSTEM_PROMPT;
pub use telemetry::init_telemetry;
pub use tool_provider::ToolProvider;
pub use tool_provider::ToolProviderContext;
pub use tools::builtin_tools;
pub use tools::ConversationHistoryTool;
pub use tools::FetchUrlTool;
pub use tools::KnowledgeResultSink;
pub use tools::KnowledgeSearchTool;
pub use tools::NoopWebSearchProvider;
pub use tools::SearchResult;
pub use tools::ToolContext;
pub use tools::WebSearchProvider;
pub use tools::WebSearchTool;
pub use smooth_operator_core;

Modules§

access_control
Document-level access control (feature gap G3).
adapter
The StorageAdapter seam.
auth
Authentication + role-based access control (Phase 12).
backplane
Connection backplane: the scale-out + event-delivery seam for the WebSocket server.
connector_config
Connector configuration storage (Phase 12, increment 3).
curation
Document sets, curation boosting, and query-time metadata filters (feature gap, Phase 11 — “Document sets / curation / boosting”).
domain
Domain model for smooth-operator.
embedding
Text → vector embedding — the shared seam for dense retrieval.
gateway_key
Per-org LLM gateway-key resolution: the seam that lets a multi-tenant deployment bill/scope each org’s turns to its own gateway key while a standalone/local server keeps using the single environment key.
rerank
Reranking — the optional post-retrieval reorder stage (feature gap G8).
runtime
Minimal AgentRuntime that proves smooth-operator consumes smooth-operator.
settings
Per-org agent settings storage (Phase 12, increment 3).
telemetry
OpenTelemetry GenAI instrumentation for the agent turn.
tool_provider
Host-contributed tool injection seam.
tools
Tools the smooth-operator runtime registers on the smooth-operator-core engine.
widget_auth
Embeddable-widget auth: an origin allowlist + public-key authContext verification for browser-embedded chat widgets (<smooth-agent-chat>).

Structs§

Checkpoint
A checkpoint captures the full state of an agent at a point in time.