Expand description
§agent-framework
A Rust implementation of the Microsoft Agent Framework for building AI agents and multi-agent workflows.
This is the umbrella crate: it re-exports agent_framework_core and, via
cargo features, the providers:
| Feature | Crate | Default |
|---|---|---|
openai | agent_framework_openai — OpenAI Chat Completions + Responses API | yes |
anthropic | [agent_framework_anthropic] — Anthropic (Claude) Messages API | no |
ollama | [agent_framework_ollama] — Ollama (local/remote, OpenAI-compatible) | no |
gemini | [agent_framework_gemini] — Google Gemini generateContent API | no |
mistral | [agent_framework_mistral] — Mistral AI Chat Completions API | no |
foundry-local | [agent_framework_foundry_local] — Microsoft Foundry Local (OpenAI-compatible localhost endpoint) | no |
bedrock | [agent_framework_bedrock] — AWS Bedrock Converse API (SigV4-signed) | no |
github-copilot | [agent_framework_github_copilot] — GitHub Copilot chat API | no |
azure | [agent_framework_azure] — Azure OpenAI (api-key / Entra ID) | no |
mcp | [agent_framework_mcp] — Model Context Protocol tools (stdio, HTTP, websocket) | no |
a2a | [agent_framework_a2a] — Agent2Agent protocol client | no |
declarative | [agent_framework_declarative] — YAML/JSON agents & workflows | no |
hosting | [agent_framework_hosting] — serve agents over HTTP (DevUI-style, A2A, OpenAI-compatible) | no |
redis | [agent_framework_redis] — Redis chat-message store & context provider | no |
mem0 | [agent_framework_mem0] — Mem0 long-term memory provider | no |
foundry | [agent_framework_foundry] — Azure AI Foundry Responses API chat client + Prompt Agents | no |
azure-ai-search | [agent_framework_azure_ai_search] — Azure AI Search memory | no |
cosmos | [agent_framework_cosmos] — Cosmos DB NoSQL message store | no |
copilotstudio | [agent_framework_copilotstudio] — Copilot Studio agents | no |
purview | [agent_framework_purview] — Purview compliance middleware | no |
full enables everything.
use agent_framework::prelude::*;
let client = OpenAIChatCompletionClient::from_env("gpt-4o-mini")?;
let agent = Agent::builder(client)
.name("assistant")
.instructions("You are a helpful assistant.")
.build();
let response = agent.run_once("What is the capital of France?").await?;
println!("{}", response.text());Re-exports§
pub use agent_framework_openai as openai;
Modules§
- agent
- Agents: the
SupportsAgentRuntrait and the concreteAgent. - client
- The chat client trait and the automatic function-invocation loop.
- compaction
- Conversation-history compaction.
- error
- Error types for the agent framework.
- history
- Conversation-history context providers.
- memory
- Context / memory providers.
- middleware
- Middleware pipelines for agents, chat clients, and function invocation.
- observability
- Lightweight OpenTelemetry GenAI-style span instrumentation, built on the
tracingcrate, plus optional GenAI metrics behind theotel-metricsfeature. - prelude
- Commonly used imports for building agents and workflows.
- session
- Conversation sessions.
- settings
- Lightweight settings helpers: a secret-masking string newtype and a precedence-based value loader.
- skills
- Skills: progressive-disclosure capability packages.
- streaming
- Utilities for decoding streamed bytes.
- tools
- Tools: executable functions and hosted-tool markers.
- types
- Core data model: content, messages, responses, and options.
- workflow
- Graph-based multi-agent workflow orchestration.
Enums§
- Error
- The primary error type for the agent framework.
Type Aliases§
- Result
- The result type used throughout the framework.