agentleFS
MicrosoftKnown publishermicrosoft-foundry/foundry-samples/samples/csharp/hosted-agents/bring-your-own/conversation_engine/basic/AGENTS.md

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. -…

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
  1. Distinctive:

    Keep echo behavior, protocol handling, tests, and documentation aligned across the three Python variants and the matching .NET sample.

    line 9
  2. Very specific:

    Keep the sample self-contained under this directory.

    line 17
  3. Very specific:

    Do not commit .vscode launch or task files generated by the Foundry Toolkit.

    line 31
  4. Distinctive:

    Keep direct package versions explicit in each project file.

    line 35
  5. Very specific:

    All packages resolve only from nuget.org through the single-source NuGet.config.

    line 36
  6. Very specific:

    Use the Azure.AI.AgentServer.Invocations 1.0.0-beta.8 Voice API with public Core beta.30.

    line 37
  7. Distinctive:

    Do not substitute beta.7, which lacks the dedicated CE API.

    line 39
  8. Common:

    Do not add credentials, local NuGet packages, VCS dependencies, or private feeds.

    line 40
  9. Very specific:

    Keep SendEcho accepting IAsyncEnumerable<string>, consumed incrementally with await foreach.

    line 44
  10. Distinctive:

    Do not buffer the source, block the receive loop, or reintroduce model clients/configuration.

    line 47
  11. Very specific:

    Use ILogger for server diagnostics.

    line 51
  12. Very specific:

    Use user.barge_in / the typed user-barge-in callback.

    line 69
  13. Distinctive:

    Follow the shared C# hosted-agent README conventions in the nearest parent instructions.

    line 91

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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.yaml declares .NET 10 and VoiceLiveBridgeBasic.dll as 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 .vscode files.

Key files

  • azure.yaml — Foundry project, hosted-agent metadata, and protocol declaration
  • src/voice-live-bridge-basic-dotnet/Program.cs — server entry point and dependency registration
  • src/voice-live-bridge-basic-dotnet/VoiceAgent.cs — SDK callbacks; user messages trigger a fixed thirty-word story stream
  • src/voice-live-bridge-basic-dotnet/VoiceResponseCoordinator.cs — interruptible response tasks and terminal sequencing
  • src/voice-live-bridge-basic-dotnet/VoiceConnectionState.cs — connection state, ID correlation, and caller-heard text
  • src/voice-live-bridge-basic-dotnet/tests/ — deterministic unit tests and test doubles
  • src/voice-live-bridge-basic-dotnet/smoke/ — protocol-aware WebSocket smoke client
  • sample.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.Invocations 1.0.0-beta.8 Voice 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.0 and use /voice_conversation_engine. Omit deprecated bridgeProtocolVersion and voiceLiveCompatible metadata; legacy metadata-selected invocations_ws remains a service/SDK compatibility path, not a requirement for this sample.
  • Bridge Protocol 1.0 is the application protocol; voice_conversation_engine 1.0.0 is 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.ready or session.rejected and owns response IDs, response tasks, interruption/cancellation/timeout handling, and connection state.
  • Simplifying OnUserMessageAsync must not remove other protocol callbacks, response/input-ID correlation, caller-heard state, or cleanup. Keep the receive loop free to process interruptions.
  • Protocol 1.0 supports 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-foundry

References

Follow the shared C# hosted-agent README conventions in the nearest parent instructions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.