foundry-samples / basic
AGENTS.md485 starsChanged 3 months agoMITView on GitHub
This is a Microsoft Foundry hosted text agent that implements Voice Live Bridge Protocol 1.0 over voice_conversation_engine. Voice Live owns the audio pipeline; this sample handles only typed text and control events. User messages trigger a fixed thirty-word story stream without an LLM client or history. Keep echo behavior, protocol handling, tests, and documentation aligned across the three Python variants and the matching .NET sample. Apply changes to both languages unless the requested scope explicitly names only one implementation. -…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository299 other files it gives its agents.
- samples/cli/prompt-agents/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/a2a/01-delegation/caller/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/a2a/01-delegation/executor/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/agent-skills/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/azure-search-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/browser-automation/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/egress-control/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/file-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-memory-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-toolbox-mcp-skills/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-toolbox-server-side/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-data-processing/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-research/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-scaling-capabilities/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/hello-world/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/invocations-echo-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/local-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/mcp-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/observability/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/resilient-workflow/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/simple-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/steerable-workflow/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/steering/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/teams-activity/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/text-search-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/toolbox-auth-paths/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/workflows/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/conversation_engine/adapter_mode/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/human-in-the-loop/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/notetaking-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations_ws/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/background-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/browser-automation/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/env-vars-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/notetaking-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/openai-computer-tool/AGENTS.mdAGENTS.md
- samples/python/autopilot-agents/foundry-toolbox/AGENTS.mdAGENTS.md
- samples/python/autopilot-agents/hello-world/AGENTS.mdAGENTS.md
- samples/python/autopilot-agents/meeting-assistant/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/a2a/01-delegation/caller/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/a2a/01-delegation/executor/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/invocations/01-basic/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/invocations/02-content-safety-guardrail/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/01-basic/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/02-tools/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/05-workflows/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/06-files/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/07-skills/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/07-teams-activity/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/08-observability/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/10-downstream-azure/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/11-azure-search-rag/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/12-foundry-skills/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/13-foundry-memory/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/14-browser-automation-agent/AGENTS.mdAGENTS.md
- The first 60 shown.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 1 is common, 5 are distinctive, and 7 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
Keep echo behavior, protocol handling, tests, and documentation aligned across the three Python variants and the matching .NET sample.
- Very specific: line 17
Keep the sample self-contained under this directory.
- Very specific: line 31
Do not commit .vscode launch or task files generated by the Foundry Toolkit.
- Distinctive: line 35
Keep direct package versions explicit in each project file.
- Very specific: line 36
All packages resolve only from nuget.org through the single-source NuGet.config.
- Very specific: line 37
Use the Azure.AI.AgentServer.Invocations 1.0.0-beta.8 Voice API with public Core beta.30.
- Distinctive: line 39
Do not substitute beta.7, which lacks the dedicated CE API.
- Common: line 40
Do not add credentials, local NuGet packages, VCS dependencies, or private feeds.
- Very specific: line 44
Keep SendEcho accepting IAsyncEnumerable<string>, consumed incrementally with await foreach.
- Distinctive: line 47
Do not buffer the source, block the receive loop, or reintroduce model clients/configuration.
- Very specific: line 51
Use ILogger for server diagnostics.
- Very specific: line 69
Use user.barge_in / the typed user-barge-in callback.
- Distinctive: line 91
Follow the shared C# hosted-agent README conventions in the nearest parent instructions.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coding Agent Instructions — Voice Live Bridge Basic .NET
This is a Microsoft Foundry hosted text agent that implements Voice Live Bridge Protocol 1.0
over voice_conversation_engine. Voice Live owns the audio pipeline; this sample handles only typed text and
control events. User messages trigger a fixed thirty-word story stream without an LLM client or history.
Cross-language consistency
Keep echo behavior, protocol handling, tests, and documentation aligned across the three Python variants and the matching .NET sample. Apply changes to both languages unless the requested scope explicitly names only one implementation.
Deployment mode
- Direct code deployment:
azure.yamldeclares .NET 10 andVoiceLiveBridgeBasic.dllas the entry point. - Keep the sample self-contained under this directory. Do not add Docker artifacts, sibling-path
dependencies, local packages, private feeds, or generated
.vscodefiles.
Key files
azure.yaml— Foundry project, hosted-agent metadata, and protocol declarationsrc/voice-live-bridge-basic-dotnet/Program.cs— server entry point and dependency registrationsrc/voice-live-bridge-basic-dotnet/VoiceAgent.cs— SDK callbacks; user messages trigger a fixed thirty-word story streamsrc/voice-live-bridge-basic-dotnet/VoiceResponseCoordinator.cs— interruptible response tasks and terminal sequencingsrc/voice-live-bridge-basic-dotnet/VoiceConnectionState.cs— connection state, ID correlation, and caller-heard textsrc/voice-live-bridge-basic-dotnet/tests/— deterministic unit tests and test doublessrc/voice-live-bridge-basic-dotnet/smoke/— protocol-aware WebSocket smoke clientsample.yaml— repository build-readiness validation
Do not commit .vscode launch or task files generated by the Foundry Toolkit.
Dependencies and feeds
- Keep direct package versions explicit in each project file.
- All packages resolve only from nuget.org through the single-source
NuGet.config. - Use the
Azure.AI.AgentServer.Invocations1.0.0-beta.8Voice API with public Core beta.30. Both packages are published on nuget.org; use normal restore, not source-built SDK packages. Do not substitute beta.7, which lacks the dedicated CE API. - Do not add credentials, local NuGet packages, VCS dependencies, or private feeds.
Streaming customization
Keep SendEcho accepting IAsyncEnumerable<string>, consumed incrementally with await foreach.
Customers replace the StreamStory async iterator inside OnUserMessageAsync.
Propagate cancellation using [EnumeratorCancellation] and WithCancellation.
Do not buffer the source, block the receive loop, or reintroduce model clients/configuration.
Runtime logging
Use ILogger for server diagnostics. Reserve Console.WriteLine for the smoke client, where stdout
is the intended interface. Never log prompts, responses, credentials, API keys, or bearer tokens.
Development workflow
From an initialized agent project, use azd provision, azd ai agent run, and azd deploy for the
hosted-agent lifecycle. Do not use azd ai agent invoke or Agent Inspector as protocol tests because
they do not produce Voice Live Bridge WebSocket events; run the smoke client instead.
Restore, build, format, and test from the sample root using the commands in sample.yaml.
Protocol constraints
- Declare only
voice_conversation_engine:1.0.0and use/voice_conversation_engine. Omit deprecatedbridgeProtocolVersionandvoiceLiveCompatiblemetadata; legacy metadata-selectedinvocations_wsremains a service/SDK compatibility path, not a requirement for this sample. - Bridge Protocol
1.0is the application protocol;voice_conversation_engine1.0.0is the Hosted Agent ingress transport version. Do not conflate them. - Use
user.barge_in/ the typed user-barge-in callback; preserve heard-text and cancellation behavior. - The application explicitly sends
session.readyorsession.rejectedand owns response IDs, response tasks, interruption/cancellation/timeout handling, and connection state. - Simplifying
OnUserMessageAsyncmust not remove other protocol callbacks, response/input-ID correlation, caller-heard state, or cleanup. Keep the receive loop free to process interruptions. - Protocol
1.0supports text input only. Do not add DTMF, image input, history mutation, or hosted-agent handoff under this version.
Microsoft Foundry Skill
For guided deployment and troubleshooting, install the Microsoft Foundry Skill:
npx skills add https://github.com/microsoft/azure-skills --skill microsoft-foundryReferences
Follow the shared C# hosted-agent README conventions in the nearest parent instructions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

