Skip to main content

Crate ares_server

Crate ares_server 

Source
Expand description

ARES agent library facade.

Downstream crates inject Execute, Tools, and Llm on a Cordis Context and run an agent with no HTTP stack on the graph.

use ares_server::{Context, Execute, Tools, Llm};

The ares-server binary (same package) binds the Axum router only when the http feature is on, and ships only with http and cli. Default features are the server defaults: postgres, openai, ares-vector, mcp, inventory, rhai-policy, http, cli, script-tools. For an embed-only build use default-features = false and pick the providers you need (e.g. features = ["openai"]); no axum, clap, sqlx, ollama, boa, or rhai then enters the graph.

Public surface: Context, Execute, Tools, Llm, Store (postgres), Plugin, Loader, Dispatch, register_plugins. Construct in-memory Llm with Llm::from_client for the library proof.

Modules§

supervisor
Daemon-side supervised-worker protocol: restart loop and child spawn. Daemon-side half of the supervised-worker protocol.

Structs§

AgentConfig
Agent configuration binding a model to tools and behavior.
AgentRegistry
Registry for managing agent configurations and creating agent instances
AgentRequest
Request for unified agent execution.
AgentResponse
Response from agent execution, including content and optional token usage
Calculator
Calculator tool for basic arithmetic operations.
CalculatorConfig
Empty config for CalculatorService. Default suffices; Serialize and Deserialize are required for Plugin Config via RegistryService.
CalculatorService
CalculatorService wraps Calculator for Cordis dependency injection.
Context
ConversationMessage
A message in a tool-calling conversation.
Entry
A single declarative loader entry.
EventsService
Execute
Unified agent execution service — the single place handling:
ExecutionMetadata
Metadata about the execution of an agent
ExecutionResult
LLMResponse
Response from an LLM generation call
Llm
Unified LLM capability composing provider registry, catalog, factory, and pool.
Loader
Declarative loader — diffs EntryTrees incrementally.
Message
A single message in a conversation.
PluginRegistry
Name-keyed directory of PluginFactory closures.
ProviderRegistry
Registry for managing multiple named LLM providers
TenantContext
TokenUsage
Token usage statistics from an LLM generation call
ToolCall
A request to call a tool.
ToolDefinition
Definition of a tool that can be called by an LLM.
Tools
Tenant-aware tool capability.

Enums§

AgentSource
Result of Execute::run including resolution metadata.
AppError
Application-wide error type.
CordisError
Dispatch
ProviderConfig
LLM provider configuration.
TenantTier

Traits§

ContextProvider
Trait for injecting external context into agent calls.
Disposable
LLMClient
Generic LLM client trait for provider abstraction
Plugin
A plugin is a declarative unit of configuration that can provide a service into a context. The registry calls apply to create the service value and then inserts it into the context with single-source discipline. The returned Arc is the live service instance that callers retrieve through ctx.get. Plain prose is used here to keep the docs readable and to avoid clever abstractions that would hide the simple flow of create then provide.
RunTracker
Trait for tracking active agent runs. Implemented by the root crate’s ActiveRuns and injected into Execute via the Context.
Service
Tool
Trait for implementing tools that agents can invoke.
TypedEvent
Compile-time binding between a catalog event and its payload type.

Functions§

register_plugins
Register capability-crate loader factories on reg.

Type Aliases§

FiberId
ServiceInitFuture
Store
Tenant database. Gated so --no-default-features builds do not enable postgres.