Crate ares

Crate ares 

Source
Expand description

§A.R.E.S - Agentic Retrieval Enhanced Server

A production-grade agentic chatbot server built in Rust with multi-provider LLM support, tool calling, RAG, MCP integration, and advanced research capabilities.

§Overview

A.R.E.S can be used in two ways:

  1. As a standalone server - Run the ares-server binary
  2. As a library - Import components into your own Rust project

§Quick Start (Library Usage)

Add to your Cargo.toml:

[dependencies]
ares-server = "0.2"

§Basic Example

use ares::{Provider, LLMClient};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create an Ollama provider
    let provider = Provider::Ollama {
        base_url: "http://localhost:11434".to_string(),
        model: "llama3.2:3b".to_string(),
    };

    // Create a client and generate a response
    let client = provider.create_client().await?;
    let response = client.generate("Hello, world!").await?;
    println!("{}", response);

    Ok(())
}

§Using Tools

use ares::{ToolRegistry, tools::calculator::Calculator};
use std::sync::Arc;

let mut registry = ToolRegistry::new();
registry.register(Arc::new(Calculator));

// Tools can be used with LLM function calling
let tool_definitions = registry.definitions();

§Configuration-Driven Setup

use ares::{AresConfigManager, AgentRegistry, ProviderRegistry, ToolRegistry};
use std::sync::Arc;

// Load configuration from ares.toml
let config_manager = AresConfigManager::new("ares.toml")?;
let config = config_manager.config();

// Create registries from configuration
let provider_registry = Arc::new(ProviderRegistry::from_config(&config));
let tool_registry = Arc::new(ToolRegistry::with_config(&config));
let agent_registry = AgentRegistry::from_config(
    &config,
    provider_registry,
    tool_registry,
);

§Feature Flags

FeatureDescription
ollamaOllama local inference (default)
openaiOpenAI API support
llamacppDirect GGUF model loading
local-dbLocal SQLite database (default)
tursoRemote Turso database
qdrantQdrant vector database
mcpModel Context Protocol support

§Modules

  • agents - Agent framework for multi-agent orchestration
  • api - REST API handlers and routes
  • auth - JWT authentication and middleware
  • db - Database abstraction (SQLite, Turso)
  • llm - LLM client implementations
  • tools - Tool definitions and registry
  • workflows - Declarative workflow engine
  • types - Common types and error handling

§Architecture

A.R.E.S uses a hybrid configuration system:

  • TOML (ares.toml): Infrastructure config (server, auth, providers)
  • TOON (config/*.toon): Behavioral config (agents, models, tools)

Both support hot-reloading for zero-downtime configuration changes.

Re-exports§

pub use agents::AgentRegistry;
pub use agents::AgentRegistryBuilder;
pub use db::TursoClient;
pub use llm::client::LLMClientFactoryTrait;
pub use llm::ConfigBasedLLMFactory;
pub use llm::LLMClient;
pub use llm::LLMClientFactory;
pub use llm::LLMResponse;
pub use llm::Provider;
pub use llm::ProviderRegistry;
pub use tools::registry::ToolRegistry;
pub use types::AppError;
pub use types::Result;
pub use utils::toml_config::AresConfig;
pub use utils::toml_config::AresConfigManager;
pub use utils::toon_config::DynamicConfigManager;
pub use workflows::WorkflowEngine;
pub use workflows::WorkflowOutput;
pub use workflows::WorkflowStep;

Modules§

agents
AI agent orchestration and management. AI agent orchestration and management.
api
HTTP API handlers and routes. HTTP API handlers and routes.
auth
JWT authentication and middleware. JWT authentication and middleware.
cli
Command-line interface and scaffolding. CLI module for A.R.E.S
db
Database clients (Turso/SQLite, Qdrant). Database clients and vector stores.
llm
LLM provider clients and abstractions. LLM provider clients and abstractions.
mcpmcp
Model Context Protocol (MCP) server integration.
memory
Conversation memory and context management. Memory management module for conversation context and user memory.
rag
Retrieval Augmented Generation (RAG) components. Retrieval Augmented Generation (RAG) components.
research
Multi-agent research coordination. Multi-agent research coordination.
tools
Built-in tools (calculator, web search). Built-in tools (calculator, web search).
types
Core types (requests, responses, errors). Core types used throughout the A.R.E.S server.
utils
Configuration utilities (TOML, TOON). Configuration utilities (TOML, TOON).
workflows
Workflow engine for agent orchestration. Workflow Engine Module

Structs§

AppState
Application state shared across handlers