ares-server 0.11.0

ARES agent server with multi-provider LLM support, tool calling, RAG, and MCP integration
Documentation
# Installation

This chapter installs the `ares-server` binary. Pick one method:

- Install from crates.io with `cargo install`.
- Build from source with `cargo build`.

## Prerequisites

You need a Rust toolchain. The crate declares `rust-version = "1.98"`, so use Rust 1.98 or newer. Check your version:

```console
$ rustc --version
```

Install Rust through [rustup](https://rustup.rs) if you do not have it.

## Install from crates.io

The crate is published as [`ares-server`](https://crates.io/crates/ares-server). Install it without pinning a version:

```bash
cargo install ares-server --locked
```

To include the embedded web UI in the build, add the `ui` feature:

```bash
cargo install ares-server --locked --features ui
```

The install puts the binary in `$HOME/.cargo/bin`. Make sure that directory is on your `PATH`.

## Build from source

Clone the repository and build the release binary:

```bash
git clone https://github.com/dirmacs/ares
cd ares
cargo build --release
```

The binary lands at `target/release/ares-server`. Copy it to a directory on your `PATH`, or call it by path.

## Feature flags

Features select database backends, vector stores, and optional extras. HTTP LLM providers come from the default `genai` feature of `ares-llm`. The table lists every feature of the `ares-server` package.

| Feature | What it enables |
|---|---|
| `default` | `postgres`, `ares-vector`, `mcp`, `inventory`, `rhai-policy`, `http`, `cli`, `script-tools` |
| `llamacpp` | In-process GGUF inference via llama.cpp (optional; HTTP providers come from `ares-llm` `genai`) |
| `postgres` | PostgreSQL tenant database through `sqlx` (default) |
| `turso` | Turso/libSQL, an edge-native SQLite-compatible store |
| `ares-vector` | Embedded pure-Rust vector store with HNSW (default) |
| `lancedb` | LanceDB embedded vector store; needs `protoc` |
| `qdrant` | Qdrant vector database client |
| `pgvector` | pgvector, a PostgreSQL extension for vectors |
| `chromadb` | ChromaDB vector database client |
| `pinecone` | Pinecone managed vector database (alpha) |
| `mcp` | MCP protocol glue, client, auth, and registry |
| `inventory` | Cordis static registration at compile time (default) |
| `rhai-policy` | Rhai policy scripts on kernel events (default) |
| `eruka-context` | Per-agent context injection from Eruka |
| `local-embeddings` | ONNX local embedding models; not on Windows MSVC |
| `hmr` | Hot swap of compiled plugins through `dlopen` |
| `skills` | SKILL.md discovery and loading |
| `email` | Email sending over SMTP |
| `search-tools` | Web search and scraping tools |
| `ui` | Embedded Leptos web UI served by the backend |
| `swagger-ui` | Interactive API documentation pages |

Feature bundles combine several flags:

| Bundle | Contents |
|---|---|
| `all-db` | `postgres` |
| `all-vectorstores` | `ares-vector`, `qdrant`, `pgvector`, `chromadb`, `pinecone` |
| `local-vectorstores` | `ares-vector` only |
| `full` | `postgres`, `qdrant`, `ares-vector`, `mcp`, `swagger-ui` |
| `full-ui` | `full` plus `ui` |
| `minimal` | Nothing optional |

### Choose feature combinations

Features compose along three independent axes. Pick one option per axis:

1. **LLM providers**. HTTP adapters ship through the default `genai` feature of `ares-llm`. Select OpenAI, Azure, Anthropic, Gemini, Bedrock, and Ollama in `ares.toml`. Optional `llamacpp` adds in-process GGUF.
2. **Database backend** (`postgres` or `turso`). The server binary requires the `postgres` feature. A binary built without it prints a rebuild hint and exits with code 1 at startup (`src/main.rs` compiles a stub `main` without it). Keep `postgres` unless you embed the library and run no HTTP server.
3. **Vector store** (`ares-vector`, `qdrant`, `pgvector`, `chromadb`, `pinecone`, `lancedb`). Clients are additive. `local-vectorstores` keeps the build small because only the embedded store compiles.

Cross-axis rules:

- `postgres` also gates sqlx code paths in `ares-store`, `ares-agent`, `ares-mcp`, `ares-tools`, and `ares-http` through feature forwarding.
- `mcp`, `inventory`, and `rhai-policy` ride in `default`. If you drop `default`, all three drop. Re-add them if you build with `--no-default-features` plus your own picks.
- `swagger-ui` needs nothing extra. The OpenAPI document includes RAG paths when `ares-vector` is on. Local ONNX embeddings still need `local-embeddings`.

Some features cost real compile time or native dependencies:

| Feature | Cost |
|---|---|
| `lancedb` | Needs the `protoc` compiler on `PATH` at build time |
| `local-embeddings` | Pulls the ONNX Runtime; unsupported on Windows MSVC; slow link step |
| `ui` | Builds the embedded Leptos UI as part of the crate; longest cold build of any single feature |
| `full-ui` | Everything above together; budget several minutes on a modest machine |

For a first install, stay on defaults plus what you actually call. Defaults already give you `postgres`, `ares-vector`, `mcp`, `inventory`, `rhai-policy`, and HTTP genai providers. Root has no `openai` Cargo feature.

### Build offline or air-gapped

The repository ships no vendor directory. For an air-gapped machine, vendor dependencies on a connected machine first:

```bash
cd ares
cargo vendor vendor
```

Copy the whole tree, including `vendor/`, to the target machine. Then point Cargo at it through `.cargo/config.toml` next to `Cargo.toml`:

```toml
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
```

Build with `cargo build --release --offline`. Two notes apply:

- SQL migrations live inside the `ares-store` crate and ship inside the published package, so an offline build needs no external migration files.
- The default TLS stack uses rustls, so you need no system OpenSSL headers. If a non-default feature drags in OpenSSL on a host without `pkg-config`/`libssl-dev`, enable its vendored form in `Cargo.toml` (see the commented `vendored` example near the end of the dependency list) instead of installing system packages.

## Troubleshoot installation

| Symptom | Cause | Fix |
|---|---|---|
| `package \`ares-server v0.11.0\` cannot be built because it requires rustc 1.98 or newer` | Toolchain older than the declared `rust-version` | Run `rustup update stable`, then retry |
| Installed binary prints `requires the \`postgres\` feature` and exits 1 | Built or installed with `--no-default-features` or without `postgres` | Reinstall with `--features postgres`, or keep `default` |
| `error: failed to run custom build command` naming `protoc` | `lancedb` enabled without Protocol Buffers compiler | Install `protoc`, or drop `lancedb` from `--features` |
| Link errors mentioning ONNXRuntime under `local-embeddings` | Missing ONNX Runtime library, or Windows MSVC host | Install ONNX Runtime, or use a remote embeddings endpoint without the feature |
| `ares-server: command not found` after install | `$HOME/.cargo/bin` missing from `PATH` | Add `export PATH="$HOME/.cargo/bin:$PATH"` to your shell profile |
| Build succeeds but `/ui` returns 404 | `ui` feature absent from this binary | Rebuild with `--features ui` |

Compile-time versus run time still matters for `llamacpp` and for database or vector-store features. HTTP LLM providers compile in by default. `ares.toml` selects among them at run time.

## Verify the install

Print the version:

```console
$ ares-server --version
ares-server 0.11.0
```