# What Programming Languages Are Used in AI Agents for Beginners?

> Discover the primary programming languages Python and C# used in the microsoft/ai-agents-for-beginners repository. Learn how to build AI agents with the Microsoft Agent Framework.

- Repository: [Microsoft/ai-agents-for-beginners](https://github.com/microsoft/ai-agents-for-beginners)
- Tags: getting-started
- Published: 2026-04-22

---

**The microsoft/ai-agents-for-beginners repository exclusively uses Python and C# (.NET) to demonstrate the Microsoft Agent Framework, with no other programming languages present in the source tree.**

The curriculum is intentionally built around these two stacks to serve both data science and enterprise development communities. Whether you work in Jupyter notebooks or .NET applications, the repository provides equivalent implementations that teach identical agentic AI patterns using the same underlying framework concepts.

## Primary Programming Languages Used in AI Agents for Beginners

### Python: The Data Science Foundation

Python serves as the core language for the majority of interactive lessons in the repository. All Python samples are distributed as Jupyter notebooks (`.ipynb` files) located in lesson-specific `code_samples` directories.

In `01-intro-to-ai-agents/code_samples/01-python-agent-framework.ipynb`, the implementation uses the `agent-framework` package (listed in [`requirements.txt`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/requirements.txt)) to create agents. The typical Python workflow involves initializing an `AzureChatClient`, defining tool functions with docstrings, and invoking `AgentFactory.create_agent()` to orchestrate LLM interactions.

Key Python files include:

- `01-intro-to-ai-agents/code_samples/01-python-agent-framework.ipynb` – Basic agent creation and tool usage
- `04-tool-use/code_samples/04-python-agent-framework.ipynb` – Advanced tool-calling patterns
- [`14-microsoft-agent-framework/code-samples/hotel_booking_workflow_sample.py`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/14-microsoft-agent-framework/code-samples/hotel_booking_workflow_sample.py) – Multi-agent orchestration workflows

### C# (.NET): The Enterprise Implementation

C# provides the equivalent .NET-based implementation using the Microsoft Agents AI SDK. Rather than notebooks, the C# samples use standalone `.cs` files that can be executed with `dotnet run` or within .NET-compatible notebook kernels.

According to [`01-intro-to-ai-agents/code_samples/01-dotnet-agent-framework.cs`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/01-intro-to-ai-agents/code_samples/01-dotnet-agent-framework.cs), the C# implementation relies on `Microsoft.Agents.AI` and `Microsoft.Extensions.AI` libraries. Developers use `[Description]` attributes to annotate tool methods and call `AIFunctionFactory.Create()` to register functions with the agent. The `OpenAIClient` class (from the OpenAI .NET library) connects to Azure AI Foundry or GitHub Models endpoints.

The C# track mirrors the Python curriculum exactly, with files like [`04-tool-use/code_samples/04-dotnet-agent-framework.cs`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/04-tool-use/code_samples/04-dotnet-agent-framework.cs) demonstrating identical tool-use patterns in the type-safe .NET ecosystem.

## Architectural Parity Across Languages

Both language tracks implement the same **Microsoft Agent Framework (MAF)** architecture, demonstrating that agent patterns are language-agnostic. The repository consciously avoids JavaScript, Java, Go, and other languages to maintain focus on these two primary stacks.

The equivalent implementations share identical structural components:

- **LLM Client Configuration**: Python uses `AzureChatClient` from the agent-framework package, while C# uses `OpenAIClient` with `OpenAIClientOptions`

- **Tool Definition**: Python functions use docstrings to describe capabilities; C# methods use `[Description]` attributes

- **Agent Instantiation**: Python calls `AgentFactory.create_agent(tools=[...])`; C# uses `openAIClient.GetChatClient(...).AsAIAgent(tools: [...])`

- **Streaming Responses**: Both support async streaming via `await agent.stream_async()` (Python) and `await agent.StreamAsync()` (C#)

## Code Implementation Comparison

The following examples from `01-intro-to-ai-agents/code_samples/` demonstrate how the same random destination tool is implemented in both languages.

### Python Implementation

```python
def get_random_destination() -> str:
    """Provides a random vacation destination."""
    destinations = [
        "Paris, France", "Tokyo, Japan", "New York City, USA",
        "Sydney, Australia", "Rome, Italy"
    ]
    return random.choice(destinations)

# Agent creation (using Microsoft Agent Framework)

from agent_framework import AgentFactory, AzureChatClient

client = AzureChatClient(endpoint=os.getenv("AZURE_AI_PROJECT_ENDPOINT"))
agent = AgentFactory.create_agent(
    client=client,
    tools=[get_random_destination],
    instructions="You are a travel assistant that suggests random destinations."
)

response = await agent.run_async("Suggest a place for my next trip.")
print(response)

```

### C# Implementation

```csharp
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using OpenAI;

// Tool Function: Random Destination Generator
[Description("Provides a random vacation destination.")]
static string GetRandomDestination()
{
    var destinations = new List<string>
    {
        "Paris, France", "Tokyo, Japan", "New York City, USA",
        "Sydney, Australia", "Rome, Italy"
    };
    var random = new Random();
    return destinations[random.Next(destinations.Count)];
}

// Configure OpenAI client to hit the GitHub Models endpoint
var openAIOptions = new OpenAIClientOptions()
{
    Endpoint = new Uri(Environment.GetEnvironmentVariable("GH_ENDPOINT") ??
                      "https://models.github.ai/inference")
};
var openAIClient = new OpenAIClient(
    new ApiKeyCredential(Environment.GetEnvironmentVariable("GH_TOKEN")), openAIOptions);

// Build the AI agent
AIAgent agent = openAIClient
    .GetChatClient(Environment.GetEnvironmentVariable("GH_MODEL_ID") ?? "openai/gpt-5-mini")
    .AsAIAgent(
        instructions: "You are a helpful AI Agent that can help plan vacations for customers at random destinations",
        tools: [AIFunctionFactory.Create(GetRandomDestination)]
    );

var response = await agent.InvokeAsync("Suggest a place for my next trip.");
Console.WriteLine(response);

```

## Key Files Referencing Language Implementation

Exploring these specific files reveals how the dual-language architecture is maintained throughout the curriculum:

- **[`AGENTS.md`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/AGENTS.md)** – High-level overview documenting language-specific sections
- **[`requirements.txt`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/requirements.txt)** – Python dependencies powering the Jupyter notebooks
- **`01-intro-to-ai-agents/code_samples/01-python-agent-framework.ipynb`** – First Python notebook showing the full agent pipeline
- **[`01-intro-to-ai-agents/code_samples/01-dotnet-agent-framework.cs`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/01-intro-to-ai-agents/code_samples/01-dotnet-agent-framework.cs)** – First C# sample mirroring the notebook logic

- **`04-tool-use/code_samples/04-python-agent-framework.ipynb`** – Tool-calling patterns in Python
- **[`04-tool-use/code_samples/04-dotnet-agent-framework.cs`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/04-tool-use/code_samples/04-dotnet-agent-framework.cs)** – Corresponding C# tool-calling implementation

- **[`14-microsoft-agent-framework/code-samples/hotel_booking_workflow_sample.py`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/14-microsoft-agent-framework/code-samples/hotel_booking_workflow_sample.py)** – Advanced Python workflow demonstrating multi-agent orchestration

## Summary

- The **microsoft/ai-agents-for-beginners** repository exclusively uses **Python** and **C# (.NET)**—no JavaScript, Java, or Go implementations exist in the source tree

- **Python** implementations use Jupyter notebooks (`.ipynb`) with the `agent-framework` package, `AzureChatClient`, and `AgentFactory.create_agent()`
- **C#** implementations use `.cs` files with `Microsoft.Agents.AI`, `OpenAIClient`, `[Description]` attributes, and `AIFunctionFactory.Create()`
- Both languages demonstrate identical **Microsoft Agent Framework** patterns, proving that agent architectures are language-agnostic
- Key file paths include `01-intro-to-ai-agents/code_samples/` and `04-tool-use/code_samples/` for both language variants

## Frequently Asked Questions

### Why does the repository use both Python and C#?

Microsoft designed the curriculum to serve two distinct developer communities: data scientists and AI researchers who predominantly use Python, and enterprise developers building production applications on .NET. By providing equivalent implementations in `01-intro-to-ai-agents/code_samples/01-python-agent-framework.ipynb` and [`01-dotnet-agent-framework.cs`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/01-dotnet-agent-framework.cs), learners can understand agent patterns in their native language while seeing that the underlying concepts are identical.

### Do I need to learn both languages to use the Microsoft Agent Framework?

No. The repository is designed so you can complete the entire learning path using only Python or only C#. Each lesson provides standalone code samples that fully implement the concepts without requiring knowledge of the other language. The dual-language approach exists purely for flexibility, not as a prerequisite.

### Can I use other programming languages like JavaScript or Java with this framework?

According to the source tree analysis, no JavaScript, Java, Go, or other language implementations exist in the repository. The Microsoft Agent Framework samples are intentionally limited to Python and C# to maintain curriculum focus. While the underlying Azure AI services support multiple languages through REST APIs, the beginner tutorials and code samples in this specific repository only cover Python and .NET.

### What dependencies are required for the Python and C# samples?

For **Python**, the [`requirements.txt`](https://github.com/microsoft/ai-agents-for-beginners/blob/main/requirements.txt) file lists the `agent-framework` package and other dependencies needed to run the Jupyter notebooks. For **C#**, the samples use NuGet package references (indicated by `#:` directives) to `Microsoft.Agents.AI`, `Microsoft.Extensions.AI`, and `OpenAI` client libraries. Both require environment variables for Azure AI Project endpoints or GitHub Models API keys to authenticate LLM requests.