Corvis LabsCorvis Labs
Open Source · MIT LicensePython 3.11+ · Azure AI Foundry

foundry-kit

A Python framework for building, managing, and serving Azure AI Foundry agents. Wire Foundry Hosted Agents to Azure AI Search vector indexes and ship to production via Azure Functions — all from a single CLI and Python SDK.

terminal — quickstart
# Install the framework
$ pip install foundry-kit
Successfully installed foundry-kit
# Initialize your project
$ foundry-kit config init
→ wrote foundry-kit.yaml
# Provision a Foundry agent
$ foundry-kit agent init my-bot \
--model gpt-4o
✓ Provisioned: asst_abc123
# Serve locally & deploy
$ foundry-kit serve
→ http://127.0.0.1:8000

The Problem

Building on Azure AI Foundry shouldn't require wiring three SDKs by hand.

Azure AI Foundry, Azure AI Search, and Azure Functions are powerful individually — but connecting them for production agent deployments means juggling credentials, index schemas, async clients, and deployment configs. foundry-kit handles all of that.

closeManual wiring of Foundry, Search, and Functions SDKs
closeRe-implementing DefaultAzureCredential in every project
closeNo standard local dev server for testing agents
closeVector index creation and embedding pipeline boilerplate

Core Capabilities

Everything you need to ship an agent.

smart_toy

Foundry Agent Management

Provision, update, and delete Azure AI Foundry Hosted Agents from the CLI or Python SDK. Prompt, model, and config tracked in foundry-kit.yaml.

travel_explore

Vector Search (RAG)

Create HNSW indexes in Azure AI Search, embed and upsert documents, and run vector similarity queries — all without touching the Search SDK directly.

code

Python SDK

FoundryClient and SearchManager expose clean async interfaces. Bring your own FastAPI routes or use the built-in app factory to get a chat endpoint in minutes.

cloud_upload

Azure Functions Deploy

One command packages and deploys your agent as an Azure Function. No manual function.json or host.json authoring — foundry-kit generates the deployment artifacts.

Python SDK

FoundryClient and SearchManager

Thin, typed wrappers around the Azure SDKs. Chat with a Foundry agent, query a vector index, and assemble a FastAPI app — all with three imports.

check_circle

Async-first

Built on asyncio — no blocking calls in your event loop

check_circle

Config-driven

Endpoints and deployment names read from foundry-kit.yaml

check_circle

DefaultAzureCredential

Works with az login locally, service principals in CI

agent.py
from foundry_kit import FoundryClient, SearchManager,
create_app, load_config
config = load_config("foundry-kit.yaml")
client = FoundryClient(config.foundry_endpoint)
# Async chat
import asyncio
reply = asyncio.run(
client.chat("asst_abc123", "What can you do?")
)
# Vector search
search = SearchManager(
config.search_endpoint,
config.openai_endpoint
)
results = search.query("my-index", "cloud AI services")

Quickstart

From pip install to deployed agent in five steps.

download
1. Install
# Requires Python 3.11+
$ pip install foundry-kit
settings
2. Configure
# Scaffolds foundry-kit.yaml
$ foundry-kit config init
→ wrote foundry-kit.yaml
smart_toy
3. Create agent
$ foundry-kit agent init my-bot \
--prompt "You are a helpful assistant." \
--model gpt-4o
✓ Provisioned: asst_abc123
play_circle
4. Serve locally
$ foundry-kit serve
→ http://127.0.0.1:8000
# POST /chat/my-bot to test
cloud_upload
5. Deploy
$ foundry-kit deploy \
--app-name my-function-app
✓ Deployed to Azure Functions

CLI Reference

All commands at a glance.

foundry-kit config init

Scaffold foundry-kit.yaml interactively

foundry-kit agent init <name>

Provision a Foundry Hosted Agent

foundry-kit agent update <name>

Update agent prompt or model

foundry-kit agent list

List all registered agents

foundry-kit agent show <name>

Show agent details and status

foundry-kit agent delete <name>

Delete agent from Foundry and config

foundry-kit index create <name>

Create an Azure AI Search HNSW index

foundry-kit index upsert

Embed and upload documents to an index

foundry-kit index query

Run a vector similarity query

foundry-kit serve

Start local FastAPI dev server at :8000

foundry-kit deploy

Deploy agents to Azure Functions

Authentication

DefaultAzureCredential — zero secrets in code.

foundry-kit uses Azure's credential chain. Set environment variables for CI/CD or run az login locally — no secrets ever touch your source.

vpn_key

Service Principal

CI/CD and production deployments

AZURE_CLIENT_IDAZURE_CLIENT_SECRETAZURE_TENANT_ID
laptop_mac

Developer Workstation

Local development — no secrets needed

az login
checklist

Prerequisites

deployed_code
Python 3.11+
cloud
Azure AI Foundry project (pre-provisioned)
travel_explore
Azure AI Search resource (for RAG)
functions
Azure Functions Core Tools (for deploy)

Ready to build with foundry-kit?

Star the repo, open an issue, or jump straight into the enterprise platform for MCP integrations, multi-tenant isolation, and production support.