Skip to content

Library API Guide

telos_agent is the library crate. It is published to crates.io and documented with rustdoc.

Install it with Cargo:

Terminal window
cargo add telos_agent

Main Entry Points

AreaPublic APIUse
Session runtimeAgentSession, AgentConfig, TurnEvent, TurnResultRun blocking or streaming agent turns.
ProvidersModelProvider, DeepSeekProvider, RoutedProvider, MockProviderConnect the runtime to LLM backends.
ToolsTool, ToolRegistry, ToolDefinition, ToolOutput, ToolContextDefine and register callable capabilities.
Built-in toolsregister_core_tools, register_core_tools_with_shell, ShellTool, PowerShellTool, file tools, code index tools, browser tools, WebFetchTool, WebSearchToolAdd filesystem, the platform/default configured shell, search, browser, and web tools.
Human approvalApprovalHandler, ApprovalRequest, ApprovalDecision, PermissionEngine, PermissionRuleGate dangerous tool execution.
PersistenceStorage, JsonlStorage, NoopStorageSave and resume sessions.
PromptPromptAssembly, PromptSection, built-in prompt sectionsBuild dynamic system prompts.
MemoryMemoryStore, ProfileManager, memory toolsPersist cross-session knowledge.
TasksTaskManager, Task, task toolsTrack agent-visible tasks.
MCPMcpManager, McpClient, McpToolBridgeBridge MCP tools into the registry.
PluginsPluginRegistry, PluginId, PluginError, BUILTIN_MARKETPLACELoad plugin-defined tools, skills, prompts, MCP servers, and subagents.
SubagentsSubagentTool, SubagentRegistry, AgentDefinition, Synapse, ForkLensRun nested or forked agent work.
DiagnosticsToolDiagnosticsSink, JsonlToolDiagnosticsSink, ToolFailureEventRecord sanitized tool failures.

Minimal Runtime Flow

use telos_agent::{
AgentConfig, AgentSession, DeepSeekConfig, DeepSeekProvider, ToolRegistry,
register_core_tools,
};
# async fn example() -> Result<(), telos_agent::AgentError> {
let provider = DeepSeekProvider::new(DeepSeekConfig::from_env("deepseek-v4-pro")?);
let mut tools = ToolRegistry::new();
register_core_tools(&mut tools);
let mut session = AgentSession::new(AgentConfig::default())?;
let result = session.run_turn(&provider, &tools, "Summarize this project").await?;
println!("{}", result.final_message.text_content());
# Ok(())
# }

DeepSeekConfig::from_env reads DEEPSEEK_API_KEY directly from the process environment. If you want to use the CLI config file’s [env] table in a custom client, read that file yourself and pass the key with DeepSeekConfig::new.

For item-level signatures and module details, use the generated Rust API reference.