agent_framework/lib.rs
1//! # agent-framework
2//!
3//! A Rust implementation of the [Microsoft Agent Framework](https://github.com/microsoft/agent-framework)
4//! for building AI agents and multi-agent workflows.
5//!
6//! This is the umbrella crate: it re-exports [`agent_framework_core`] and, via
7//! cargo features, the providers:
8//!
9//! | Feature | Crate | Default |
10//! | --- | --- | --- |
11//! | `openai` | [`agent_framework_openai`] — OpenAI Chat Completions + Responses API | yes |
12//! | `anthropic` | [`agent_framework_anthropic`] — Anthropic (Claude) Messages API | no |
13//! | `ollama` | [`agent_framework_ollama`] — Ollama (local/remote, OpenAI-compatible) | no |
14//! | `gemini` | [`agent_framework_gemini`] — Google Gemini `generateContent` API | no |
15//! | `mistral` | [`agent_framework_mistral`] — Mistral AI Chat Completions API | no |
16//! | `foundry-local` | [`agent_framework_foundry_local`] — Microsoft Foundry Local (OpenAI-compatible localhost endpoint) | no |
17//! | `bedrock` | [`agent_framework_bedrock`] — AWS Bedrock Converse API (SigV4-signed) | no |
18//! | `github-copilot` | [`agent_framework_github_copilot`] — GitHub Copilot chat API | no |
19//! | `azure` | [`agent_framework_azure`] — Azure OpenAI (api-key / Entra ID) | no |
20//! | `mcp` | [`agent_framework_mcp`] — Model Context Protocol tools (stdio, HTTP, websocket) | no |
21//! | `a2a` | [`agent_framework_a2a`] — Agent2Agent protocol client | no |
22//! | `experimental-declarative-agents` | [`agent_framework_declarative`] — YAML/JSON agents & workflows (experimental) | no |
23//! | `hosting` | [`agent_framework_hosting`] — serve agents over HTTP (DevUI-style, A2A, AG-UI, OpenAI-compatible) | no |
24//! | `agui-client` | `agent_framework_hosting::agui::AgUiChatClient` — a chat client for remote AG-UI servers (implies `hosting`) | no |
25//! | `redis` | [`agent_framework_redis`] — Redis chat-message store & context provider | no |
26//! | `mem0` | [`agent_framework_mem0`] — Mem0 long-term memory provider | no |
27//! | `foundry` | [`agent_framework_foundry`] — Azure AI Foundry Responses API chat client + Prompt Agents | no |
28//! | `azure-ai-search` | [`agent_framework_azure_ai_search`] — Azure AI Search memory + vector store | no |
29//! | `cosmos` | [`agent_framework_cosmos`] — Cosmos DB NoSQL message store, workflow checkpoints, and vector store | no |
30//! | `copilotstudio` | [`agent_framework_copilotstudio`] — Copilot Studio agents | no |
31//! | `purview` | [`agent_framework_purview`] — Purview compliance middleware | no |
32//! | `tools` | [`agent_framework_tools`] — built-in tools: local and Docker shell (re-exported as `builtin_tools`) | no |
33//!
34//! `full` enables every stable integration above. APIs upstream still marks
35//! experimental sit behind `experimental-*` features with no semver promise:
36//! `experimental-vector-stores`, `experimental-file-history`,
37//! `experimental-progressive-tools`, `experimental-agent-hooks` (the
38//! `agent_hooks` module of [`agent_framework_core`]), `experimental-harness` and
39//! `experimental-declarative-agents`.
40//! `experimental` turns them all on.
41//!
42//! ```no_run
43//! use agent_framework::prelude::*;
44//!
45//! # async fn demo() -> Result<()> {
46//! let client = OpenAIChatCompletionClient::from_env("gpt-4o-mini")?;
47//! let agent = Agent::builder(client)
48//! .name("assistant")
49//! .instructions("You are a helpful assistant.")
50//! .build();
51//!
52//! let response = agent.run_once("What is the capital of France?").await?;
53//! println!("{}", response.text());
54//! # Ok(())
55//! # }
56//! ```
57
58#![doc(html_root_url = "https://docs.rs/agent-framework")]
59
60pub use agent_framework_core::*;
61
62/// The OpenAI provider (enabled by the default `openai` feature).
63#[cfg(feature = "openai")]
64pub use agent_framework_openai as openai;
65
66/// The Anthropic (Claude) provider (enable the `anthropic` feature).
67#[cfg(feature = "anthropic")]
68pub use agent_framework_anthropic as anthropic;
69
70/// The Ollama provider (enable the `ollama` feature).
71#[cfg(feature = "ollama")]
72pub use agent_framework_ollama as ollama;
73
74/// The Google Gemini provider (enable the `gemini` feature).
75#[cfg(feature = "gemini")]
76pub use agent_framework_gemini as gemini;
77
78/// The Mistral AI provider (enable the `mistral` feature).
79#[cfg(feature = "mistral")]
80pub use agent_framework_mistral as mistral;
81
82/// The Microsoft Foundry Local provider (enable the `foundry-local` feature).
83#[cfg(feature = "foundry-local")]
84pub use agent_framework_foundry_local as foundry_local;
85
86/// The AWS Bedrock provider (enable the `bedrock` feature).
87#[cfg(feature = "bedrock")]
88pub use agent_framework_bedrock as bedrock;
89
90/// The GitHub Copilot provider (enable the `github-copilot` feature).
91#[cfg(feature = "github-copilot")]
92pub use agent_framework_github_copilot as github_copilot;
93
94/// The Azure OpenAI provider (enable the `azure` feature).
95#[cfg(feature = "azure")]
96pub use agent_framework_azure as azure;
97
98/// Model Context Protocol tools (enable the `mcp` feature).
99#[cfg(feature = "mcp")]
100pub use agent_framework_mcp as mcp;
101
102/// Agent2Agent protocol client (enable the `a2a` feature).
103#[cfg(feature = "a2a")]
104pub use agent_framework_a2a as a2a;
105
106/// Declarative YAML/JSON agents and workflows (enable the `experimental-declarative-agents` feature).
107#[cfg(feature = "experimental-declarative-agents")]
108pub use agent_framework_declarative as declarative;
109
110/// HTTP hosting: DevUI-style, A2A, and OpenAI-compatible serving (enable the `hosting` feature).
111#[cfg(feature = "hosting")]
112pub use agent_framework_hosting as hosting;
113
114/// Redis-backed chat-message store and context provider (enable the `redis` feature).
115#[cfg(feature = "redis")]
116pub use agent_framework_redis as redis;
117
118/// Mem0 long-term memory context provider (enable the `mem0` feature).
119#[cfg(feature = "mem0")]
120pub use agent_framework_mem0 as mem0;
121
122/// Azure AI Foundry Responses API chat client + Prompt Agents (enable the
123/// `foundry` feature).
124#[cfg(feature = "foundry")]
125pub use agent_framework_foundry as foundry;
126
127/// Azure AI Search context provider and vector store (enable the
128/// `azure-ai-search` feature).
129#[cfg(feature = "azure-ai-search")]
130pub use agent_framework_azure_ai_search as azure_ai_search;
131
132/// Azure Cosmos DB NoSQL chat-message store, checkpoint storage, and
133/// vector store (enable the `cosmos` feature).
134#[cfg(feature = "cosmos")]
135pub use agent_framework_cosmos as cosmos;
136
137/// Microsoft Copilot Studio agent client (enable the `copilotstudio` feature).
138#[cfg(feature = "copilotstudio")]
139pub use agent_framework_copilotstudio as copilotstudio;
140
141/// Microsoft Purview compliance middleware (enable the `purview` feature).
142#[cfg(feature = "purview")]
143pub use agent_framework_purview as purview;
144
145/// Built-in tools: the local and Docker shell tools (enable the `tools`
146/// feature). Re-exported as `builtin_tools` because `tools` is already the
147/// core's tool module.
148#[cfg(feature = "tools")]
149pub use agent_framework_tools as builtin_tools;
150
151/// Commonly used imports for building agents and workflows.
152pub mod prelude {
153 pub use agent_framework_core::prelude::*;
154
155 #[cfg(feature = "openai")]
156 pub use agent_framework_openai::{
157 OpenAIChatClient, OpenAIChatCompletionClient, OpenAIEmbeddingClient,
158 };
159
160 #[cfg(feature = "anthropic")]
161 pub use agent_framework_anthropic::{
162 AnthropicBedrockClient, AnthropicClient, AnthropicFoundryClient, AnthropicVertexClient,
163 };
164
165 #[cfg(feature = "ollama")]
166 pub use agent_framework_ollama::{OllamaChatClient, OllamaEmbeddingClient};
167
168 #[cfg(feature = "gemini")]
169 pub use agent_framework_gemini::GeminiChatClient;
170
171 #[cfg(feature = "mistral")]
172 pub use agent_framework_mistral::{MistralChatClient, MistralEmbeddingClient};
173
174 #[cfg(feature = "foundry-local")]
175 pub use agent_framework_foundry_local::FoundryLocalChatClient;
176
177 #[cfg(feature = "bedrock")]
178 pub use agent_framework_bedrock::{BedrockChatClient, BedrockEmbeddingClient};
179
180 #[cfg(feature = "github-copilot")]
181 pub use agent_framework_github_copilot::GitHubCopilotChatClient;
182
183 #[cfg(feature = "azure")]
184 pub use agent_framework_azure::{
185 AzureOpenAIClient, AzureOpenAIEmbeddingClient, StaticTokenCredential, TokenCredential,
186 };
187
188 #[cfg(feature = "mcp")]
189 pub use agent_framework_mcp::{McpStdioTool, McpStreamableHttpTool, McpWebsocketTool};
190
191 #[cfg(feature = "a2a")]
192 pub use agent_framework_a2a::{A2AAgent, A2AClient};
193
194 #[cfg(feature = "experimental-declarative-agents")]
195 pub use agent_framework_declarative::DeclarativeLoader;
196
197 #[cfg(feature = "hosting")]
198 pub use agent_framework_hosting::AgentHost;
199
200 #[cfg(feature = "redis")]
201 pub use agent_framework_redis::{RedisChatMessageStore, RedisContextProvider};
202
203 #[cfg(feature = "mem0")]
204 pub use agent_framework_mem0::Mem0Provider;
205
206 #[cfg(feature = "foundry")]
207 pub use agent_framework_foundry::{FoundryAgent, FoundryChatClient, FoundryEmbeddingClient};
208
209 #[cfg(feature = "azure-ai-search")]
210 pub use agent_framework_azure_ai_search::AzureAISearchProvider;
211
212 // The vector store is experimental in the crate itself.
213 #[cfg(all(feature = "azure-ai-search", feature = "experimental-vector-stores"))]
214 pub use agent_framework_azure_ai_search::{AzureAISearchCollection, AzureAISearchStore};
215
216 #[cfg(feature = "cosmos")]
217 pub use agent_framework_cosmos::CosmosChatMessageStore;
218
219 #[cfg(feature = "copilotstudio")]
220 pub use agent_framework_copilotstudio::CopilotStudioAgent;
221
222 #[cfg(feature = "purview")]
223 pub use agent_framework_purview::{PurviewAgentMiddleware, PurviewChatMiddleware};
224
225 #[cfg(feature = "tools")]
226 pub use agent_framework_tools::{DockerShellTool, LocalShellTool};
227}