Skip to main content

smooth_operator/
lib.rs

1//! # smooth-operator
2//!
3//! The reference core for smooth-operator — the service layer on top of
4//! [`smooth_operator_core`] (the agent engine). It defines three things:
5//!
6//! - [`domain`] — storage-agnostic domain structs (Conversation, Participant,
7//!   Message, Session) that mirror `spec/domain/*.json`. Checkpoints re-use the
8//!   engine's [`smooth_operator_core::Checkpoint`].
9//! - [`adapter`] — the single [`StorageAdapter`] seam every backend implements
10//!   (see `docs/STORAGE.md`). Its checkpoint/knowledge accessors return
11//!   smooth-operator-core's own traits so the engine plugs straight in.
12//! - [`runtime`] — a minimal [`AgentRuntime`] that constructs a real
13//!   smooth-operator [`Agent`](smooth_operator_core::Agent) and
14//!   [`Workflow`](smooth_operator_core::Workflow), proving consumption.
15//!
16//! It also owns two shared retrieval seams both backends/consumers depend on:
17//! [`embedding`] (the text→vector [`Embedder`] + the network-free
18//! [`DeterministicEmbedder`], the one home for both the Postgres adapter and the
19//! ingestion pipeline) and [`rerank`] (the optional post-retrieval [`Reranker`]
20//! stage — feature gap G8).
21
22pub mod access_control;
23pub mod adapter;
24pub mod auth;
25pub mod backplane;
26pub mod connector_config;
27pub mod curation;
28pub mod domain;
29pub mod embedding;
30pub mod gateway_key;
31pub mod rerank;
32pub mod runtime;
33pub mod settings;
34pub mod telemetry;
35pub mod tool_provider;
36pub mod tools;
37pub mod widget_auth;
38
39pub use access_control::{AccessContext, AclKnowledgeStore, DocAcl};
40pub use adapter::{ConversationUpdate, MessagePage, MessageQuery, SessionUpdate, StorageAdapter};
41pub use auth::{
42    AuthConfig, AuthError, AuthVerifier, JwtVerifier, NoAuthVerifier, Principal, Role,
43    SmooIdentityVerifier,
44};
45pub use connector_config::{
46    ConnectorConfig, ConnectorConfigStore, ConnectorKind, InMemoryConnectorConfigStore,
47};
48pub use curation::{
49    with_boost, with_document_set, CuratedKnowledgeStore, DocMeta, RetrievalFilter, DEFAULT_BOOST,
50};
51pub use domain::{
52    Checkpoint, Citation, ContentItem, Conversation, Direction, Message, MessageContent,
53    Participant, ParticipantRef, ParticipantType, Platform, Session, SessionStatus,
54    CITATION_SNIPPET_MAX_CHARS,
55};
56pub use embedding::{
57    cosine_similarity, DeterministicEmbedder, Embedder, InputType, DEFAULT_EMBEDDING_DIM,
58};
59pub use gateway_key::{resolve_gateway_key, EnvGatewayKeyResolver, GatewayKeyResolver};
60pub use rerank::{apply_optional_rerank, LexicalReranker, NoopReranker, Reranker};
61pub use runtime::{
62    AgentRuntime, KnowledgeChatRuntime, SharedRuntime, TurnOutcome, TurnState, MAX_CITATIONS,
63};
64pub use settings::{
65    AgentSettings, InMemorySettingsStore, SettingsStore, DEFAULT_MODEL, DEFAULT_SYSTEM_PROMPT,
66};
67pub use telemetry::init_telemetry;
68pub use tool_provider::{ToolProvider, ToolProviderContext};
69pub use tools::{
70    builtin_tools, ConversationHistoryTool, FetchUrlTool, KnowledgeResultSink, KnowledgeSearchTool,
71    NoopWebSearchProvider, SearchResult, ToolContext, WebSearchProvider, WebSearchTool,
72};
73
74// Re-export the engine so adapter crates and consumers depend on one version.
75pub use smooth_operator_core;