Bumps [postcss](https://github.com/postcss/postcss) from 8.5.22 to 8.5.25. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.5.22...8.5.25) --- updated-dependencies: - dependency-name: postcss dependency-version: 8.5.25 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AG-UI Single Agent Demo
The simplest possible AG-UI integration: a single chat agent with no tools and no context providers, served over the AG-UI protocol and consumed by a small React client.
Use this sample as the starting point for AG-UI. For a richer, multi-agent example with tool-approval checkpoints
and human-in-the-loop resumes, see ../ag_ui_workflow_handoff.
Folder Layout
backend/server.py- FastAPI + AG-UI endpoint wrapping a singleAgentfrontend/- Vite + React AG-UI client UI
Prerequisites
- Python 3.10+
- Node.js 20.19+ or 22.12+
- npm 9+
- Azure AI project + model deployment configured in environment variables:
FOUNDRY_PROJECT_ENDPOINTFOUNDRY_MODEL
- Azure CLI authenticated with
az login
1) Run Backend
From the repository root:
cd python
uv sync
uv run python samples/05-end-to-end/ag_ui_single_agent/backend/server.py
Backend default URL:
http://127.0.0.1:8892- AG-UI endpoint:
POST http://127.0.0.1:8892/agent
To export traces to the Application Insights resource connected to the Foundry project, run the backend with:
ENABLE_AZURE_MONITOR=true uv run python samples/05-end-to-end/ag_ui_single_agent/backend/server.py
Each user turn is a separate run and trace. The stable AG-UI thread_id is recorded as
gen_ai.conversation.id, which lets Foundry group those turns into one conversation.
2) Install Frontend Packages (npm)
From the python/ directory (where Step 1 left you):
cd samples/05-end-to-end/ag_ui_single_agent/frontend
npm install
3) Run Frontend Locally
npm run dev
Frontend default URL:
http://127.0.0.1:5173
If you changed backend host/port, run with:
VITE_BACKEND_URL=http://127.0.0.1:8892 npm run dev
4) Demo Flow to Verify
- Click one of the starter prompts (or type your own message).
- Watch the assistant response stream in token by token.
- Send a follow-up that depends on the previous turn (for example: "summarize what you just told me").
The client only sends the newest message plus the
thread_id; the server replays the stored history. - Click New Thread to start a fresh conversation (a new
thread_id).
Conversation History
The client only ever sends the newest message plus a thread_id. The backend retains history server-side,
keyed by that thread_id, using an InMemoryAGUIThreadSnapshotStore. Because an AG-UI thread id is not an
authorization boundary, a snapshot_scope_resolver is required whenever a snapshot store is configured; this
single-tenant demo maps every request to one shared "demo" scope.
The in-memory store is process-local and not durable. Swap in your own AGUIThreadSnapshotStore implementation
(and a real scope resolver) for production.
What This Validates
add_agent_framework_fastapi_endpoint(...)with a plainAgent(noAgentFrameworkWorkflowwrapper)- Streaming assistant text via
TEXT_MESSAGE_START/TEXT_MESSAGE_CONTENT/TEXT_MESSAGE_ENDAG-UI events - Server-side conversation history keyed by
thread_idvia a snapshot store - Foundry trace correlation across runs using the stable AG-UI
thread_id