microagents

A minimal, modular AI-agent framework written in Rust. Small core, pluggable storage, event-driven architecture, and a batteries-included TUI.

Multi-Provider LLMs Session Persistence Skills and Custom Tools Open Source (MIT)
cargo +nightly install microagents-cli

Features

🔌 Multi-provider LLM support

OpenAI, OpenRouter, Groq, and Ollama out of the box via ultrafast-models-sdk.

🛠 Tool-use loop

Agents call tools, wait for results, and continue the conversation. Parallel tool calls supported.

📦 Skills

Drop-in markdown skill packs with front-matter loaded from ./.agents/skills or ~/.agents/skills.

💾 Session storage

Resume conversations with in-memory, JSONL, or SQLite backends.

🔍 Hybrid search

Semantic + sparse (BM25) search over your workspace, powered by Qdrant, fastembed, and astchunk.

🖥 Embedded TUI

Ratatui-based chat interface with streaming deltas, tool-call visualization, and session resume.

Architecture

microagents-cli
binary: microag
TUI + built-in tools + vector search indexing
microagents-core
Agent trait, MicroAgent builder, tool loop, skill loader
microagents-events
Structured events → JSON-RPC notifications
microagents-storage
In-memory / JSONL / SQLite session backends

Quick Start

Run the TUI with default settings, or customize provider, model, and storage:

# Default TUI
microag

# Custom provider & model
microag --provider ollama --model gemma4:latest --storage sqlite

# Resume a session
microag --session-id <session-id>

# Headless mode (JSON-RPC output)
microag -p 'Where is AgentStorage defined?'

# Verbose indexing
microag --verbose -p 'Which storage backends implement AgentStorage?'

Programmatic Usage

use microagents_core::{
    agent::{MicroAgentBuilder, SupportedProvider},
    types::{Agent, ToolExecutionContext},
};
use microagents_storage::types::AgentStorageChoice;
use std::sync::Arc;

let agent = MicroAgentBuilder::new(ToolExecutionContext::new(()))
    .provider("openrouter".to_string())?
    .model("anthropic/claude-opus-4.7".to_string())
    .storage(AgentStorageChoice::Sqlite)
    .await?
    .find_skills()?
    .build()?;

let mut stream = agent.run("Hello!".to_string(), None).await?;
while let Some(event) = stream.next().await { /* … */ }

Workspace Crates

Crate Purpose
microagents-core Agent definition, tool trait, skill loading, LLM generation loop
microagents-events Event types (AgentEventAny, SessionInitEvent, …) and JSON-RPC serialization
microagents-storage Session persistence: in-memory, JSONL, or SQLite
microagents-cli Interactive terminal UI + built-in tools (read, write, edit, shell_execute, search)