agent-framework 0.15.0

A Rust implementation of the Microsoft Agent Framework: build AI agents and multi-agent workflows. Meta-crate re-exporting core and providers.
Documentation
//! # agent-framework
//!
//! A Rust implementation of the [Microsoft Agent Framework](https://github.com/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 |
//! | `claude` | [`agent_framework_claude`] — the Claude Code CLI as an agent (Claude Agent SDK protocol) | 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 |
//! | `experimental-declarative-agents` | [`agent_framework_declarative`] — YAML/JSON agents & workflows (experimental) | no |
//! | `hosting` | [`agent_framework_hosting`] — serve agents over HTTP (DevUI-style, A2A, AG-UI, OpenAI-compatible) | no |
//! | `agui-client` | `agent_framework_hosting::agui::AgUiChatClient` — a chat client for remote AG-UI servers (implies `hosting`) | 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 |
//! | `foundry-hosting` | [`agent_framework_foundry_hosting`] — host agents and workflows as Azure AI Foundry hosted agents | no |
//! | `azure-ai-search` | [`agent_framework_azure_ai_search`] — Azure AI Search memory + vector store | no |
//! | `qdrant` | [`agent_framework_qdrant`] — Qdrant vector store (experimental) | no |
//! | `postgres` | [`agent_framework_postgres`] — PostgreSQL + pgvector vector store (experimental) | no |
//! | `sql-server` | [`agent_framework_sql_server`] — SQL Server vector store (experimental) | no |
//! | `mongodb` | [`agent_framework_mongodb`] — MongoDB Atlas vector store (experimental) | no |
//! | `azure-documentdb` | [`agent_framework_azure_documentdb`] — Azure DocumentDB (MongoDB vCore) vector store (experimental) | no |
//! | `cosmos` | [`agent_framework_cosmos`] — Cosmos DB NoSQL message store, workflow checkpoints, and vector store | no |
//! | `copilotstudio` | [`agent_framework_copilotstudio`] — Copilot Studio agents | no |
//! | `purview` | [`agent_framework_purview`] — Purview compliance middleware | no |
//! | `tools` | [`agent_framework_tools`] — built-in tools: local and Docker shell (re-exported as `builtin_tools`) | no |
//!
//! `full` enables every stable integration above. APIs upstream still marks
//! experimental sit behind `experimental-*` features with no semver promise:
//! `experimental-vector-stores`, `experimental-file-history`,
//! `experimental-progressive-tools`, `experimental-agent-hooks` (the
//! `agent_hooks` module of [`agent_framework_core`]), `experimental-fides`
//! (its `security` module), `experimental-computer-use` (computer-use content,
//! the OpenAI and Foundry mappings), `experimental-harness` and
//! `experimental-declarative-agents`.
//! `experimental` turns them all on.
//!
//! ```no_run
//! use agent_framework::prelude::*;
//!
//! # async fn demo() -> Result<()> {
//! 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());
//! # Ok(())
//! # }
//! ```

#![doc(html_root_url = "https://docs.rs/agent-framework")]

pub use agent_framework_core::*;

/// The OpenAI provider (enabled by the default `openai` feature).
#[cfg(feature = "openai")]
pub use agent_framework_openai as openai;

/// The Anthropic (Claude) provider (enable the `anthropic` feature).
#[cfg(feature = "anthropic")]
pub use agent_framework_anthropic as anthropic;

/// The Ollama provider (enable the `ollama` feature).
#[cfg(feature = "ollama")]
pub use agent_framework_ollama as ollama;

/// The Google Gemini provider (enable the `gemini` feature).
#[cfg(feature = "gemini")]
pub use agent_framework_gemini as gemini;

/// The Mistral AI provider (enable the `mistral` feature).
#[cfg(feature = "mistral")]
pub use agent_framework_mistral as mistral;

/// The Microsoft Foundry Local provider (enable the `foundry-local` feature).
#[cfg(feature = "foundry-local")]
pub use agent_framework_foundry_local as foundry_local;

/// The AWS Bedrock provider (enable the `bedrock` feature).
#[cfg(feature = "bedrock")]
pub use agent_framework_bedrock as bedrock;

/// The Claude Code CLI as an agent (enable the `claude` feature).
#[cfg(feature = "claude")]
pub use agent_framework_claude as claude;
/// The GitHub Copilot provider (enable the `github-copilot` feature).
#[cfg(feature = "github-copilot")]
pub use agent_framework_github_copilot as github_copilot;

/// The Azure OpenAI provider (enable the `azure` feature).
#[cfg(feature = "azure")]
pub use agent_framework_azure as azure;

/// Model Context Protocol tools (enable the `mcp` feature).
#[cfg(feature = "mcp")]
pub use agent_framework_mcp as mcp;

/// Agent2Agent protocol client (enable the `a2a` feature).
#[cfg(feature = "a2a")]
pub use agent_framework_a2a as a2a;

/// Declarative YAML/JSON agents and workflows (enable the `experimental-declarative-agents` feature).
#[cfg(feature = "experimental-declarative-agents")]
pub use agent_framework_declarative as declarative;

/// HTTP hosting: DevUI-style, A2A, and OpenAI-compatible serving (enable the `hosting` feature).
#[cfg(feature = "hosting")]
pub use agent_framework_hosting as hosting;

/// Redis-backed chat-message store and context provider (enable the `redis` feature).
#[cfg(feature = "redis")]
pub use agent_framework_redis as redis;

/// Mem0 long-term memory context provider (enable the `mem0` feature).
#[cfg(feature = "mem0")]
pub use agent_framework_mem0 as mem0;

/// Azure AI Foundry Responses API chat client + Prompt Agents (enable the
/// `foundry` feature).
#[cfg(feature = "foundry")]
pub use agent_framework_foundry as foundry;
/// Azure AI Foundry hosted agents (the `foundry-hosting` feature).
#[cfg(feature = "foundry-hosting")]
pub use agent_framework_foundry_hosting as foundry_hosting;

/// Azure AI Search context provider and vector store (enable the
/// `azure-ai-search` feature).
#[cfg(feature = "azure-ai-search")]
pub use agent_framework_azure_ai_search as azure_ai_search;
/// The Azure DocumentDB (MongoDB vCore) vector store (the experimental `azure-documentdb` feature).
#[cfg(feature = "azure-documentdb")]
pub use agent_framework_azure_documentdb as azure_documentdb;
/// The MongoDB Atlas vector store (the experimental `mongodb` feature).
#[cfg(feature = "mongodb")]
pub use agent_framework_mongodb as mongodb;
/// The PostgreSQL + pgvector vector store (the experimental `postgres` feature).
#[cfg(feature = "postgres")]
pub use agent_framework_postgres as postgres;
/// The Qdrant vector store (the experimental `qdrant` feature).
#[cfg(feature = "qdrant")]
pub use agent_framework_qdrant as qdrant;
/// The SQL Server vector store (the experimental `sql-server` feature).
#[cfg(feature = "sql-server")]
pub use agent_framework_sql_server as sql_server;

/// Azure Cosmos DB NoSQL chat-message store, checkpoint storage, and
/// vector store (enable the `cosmos` feature).
#[cfg(feature = "cosmos")]
pub use agent_framework_cosmos as cosmos;

/// Microsoft Copilot Studio agent client (enable the `copilotstudio` feature).
#[cfg(feature = "copilotstudio")]
pub use agent_framework_copilotstudio as copilotstudio;

/// Microsoft Purview compliance middleware (enable the `purview` feature).
#[cfg(feature = "purview")]
pub use agent_framework_purview as purview;

/// Built-in tools: the local and Docker shell tools (enable the `tools`
/// feature). Re-exported as `builtin_tools` because `tools` is already the
/// core's tool module.
#[cfg(feature = "tools")]
pub use agent_framework_tools as builtin_tools;

/// Commonly used imports for building agents and workflows.
pub mod prelude {
    pub use agent_framework_core::prelude::*;

    #[cfg(feature = "openai")]
    pub use agent_framework_openai::{
        OpenAIChatClient, OpenAIChatCompletionClient, OpenAIEmbeddingClient,
    };

    #[cfg(feature = "anthropic")]
    pub use agent_framework_anthropic::{
        AnthropicBedrockClient, AnthropicClient, AnthropicFoundryClient, AnthropicVertexClient,
    };

    #[cfg(feature = "ollama")]
    pub use agent_framework_ollama::{OllamaChatClient, OllamaEmbeddingClient};

    #[cfg(feature = "gemini")]
    pub use agent_framework_gemini::GeminiChatClient;

    #[cfg(feature = "mistral")]
    pub use agent_framework_mistral::{MistralChatClient, MistralEmbeddingClient};

    #[cfg(feature = "foundry-local")]
    pub use agent_framework_foundry_local::FoundryLocalChatClient;

    #[cfg(feature = "bedrock")]
    pub use agent_framework_bedrock::{BedrockChatClient, BedrockEmbeddingClient};

    #[cfg(feature = "github-copilot")]
    pub use agent_framework_github_copilot::GitHubCopilotChatClient;

    #[cfg(feature = "azure")]
    pub use agent_framework_azure::{
        AzureOpenAIClient, AzureOpenAIEmbeddingClient, StaticTokenCredential, TokenCredential,
    };

    #[cfg(feature = "mcp")]
    pub use agent_framework_mcp::{McpStdioTool, McpStreamableHttpTool, McpWebsocketTool};

    #[cfg(feature = "a2a")]
    pub use agent_framework_a2a::{A2AAgent, A2AClient};

    #[cfg(feature = "experimental-declarative-agents")]
    pub use agent_framework_declarative::DeclarativeLoader;

    #[cfg(feature = "hosting")]
    pub use agent_framework_hosting::AgentHost;

    #[cfg(feature = "redis")]
    pub use agent_framework_redis::{RedisChatMessageStore, RedisContextProvider};

    #[cfg(feature = "mem0")]
    pub use agent_framework_mem0::Mem0Provider;

    #[cfg(feature = "foundry")]
    pub use agent_framework_foundry::{FoundryAgent, FoundryChatClient, FoundryEmbeddingClient};

    #[cfg(feature = "azure-ai-search")]
    pub use agent_framework_azure_ai_search::AzureAISearchProvider;

    // The vector store is experimental in the crate itself.
    #[cfg(all(feature = "azure-ai-search", feature = "experimental-vector-stores"))]
    pub use agent_framework_azure_ai_search::{AzureAISearchCollection, AzureAISearchStore};

    #[cfg(feature = "cosmos")]
    pub use agent_framework_cosmos::CosmosChatMessageStore;

    #[cfg(feature = "copilotstudio")]
    pub use agent_framework_copilotstudio::CopilotStudioAgent;

    #[cfg(feature = "purview")]
    pub use agent_framework_purview::{PurviewAgentMiddleware, PurviewChatMiddleware};

    #[cfg(feature = "tools")]
    pub use agent_framework_tools::{DockerShellTool, LocalShellTool};
}