microagents-core
Core agent runtime for the MicroAgents ecosystem. It provides the building blocks for creating LLM-powered agents that can use tools, load domain-specific skills, and persist conversation sessions across multiple storage backends.
What it does
- Agent construction — configure an agent via a fluent builder, choosing the LLM provider, model, tools, skills, and storage backend.
- Streaming generation — talk to OpenAI, Groq, OpenRouter, or a local Ollama instance and receive token-level streaming responses.
- Tool calling — register Rust implementations of
ToolFunction; the runtime validates JSON arguments against a schema, executes tools (optionally in parallel), and feeds results back to the model. - Skills — load markdown-based skill definitions from
.agents/skillsor~/.agents/skills. Skills are injected into the system prompt so the model can reason about specialised domains. - Session persistence — resume conversations from JSONL, SQLite, or in-memory storage.
Quick example
use MicroAgentBuilder;
use ToolExecutionContext;
use StreamExt;
let agent = new
.provider?
.model
.find_skills?
.build?;
let mut stream = agent.run.await?;
while let Some = stream.next.await
Module overview
| Module | Purpose |
|---|---|
agent |
MicroAgent / MicroAgentBuilder, provider configuration, and the main Agent trait implementation. |
types |
Core types: Agent trait, ToolFunction, ToolExecutionContext, error types, and stream aliases. |
common |
Shared helpers: event-to-message conversion, JSON fragment parsing, and the tool call dispatcher. |
skills |
Skill discovery and front-matter parsing from markdown files. |
Supported providers
- OpenAI — requires
OPENAI_API_KEY - Groq — requires
GROQ_API_KEY - OpenRouter — requires
OPENROUTER_API_KEY - Ollama — reads
OLLAMA_BASE_URL(defaults tohttp://localhost:11434/v1)