Skip to content

feat: add Pydantic AI extended sample#639

Open
simple-agent-manager[bot] wants to merge 2 commits intomainfrom
feat/pydantic-ai-extended
Open

feat: add Pydantic AI extended sample#639
simple-agent-manager[bot] wants to merge 2 commits intomainfrom
feat/pydantic-ai-extended

Conversation

@simple-agent-manager
Copy link
Copy Markdown

@simple-agent-manager simple-agent-manager Bot commented May 7, 2026

Summary

  • Adds a new pydantic-ai-extended sample: a multi-service AI app built with Pydantic AI, FastAPI, PostgreSQL (pgvector), and Redis
  • Follows the same architecture as the mastra-extended sample, adapted for the Python ecosystem
  • Background worker generates sample support tickets and system alerts, classifies them with an LLM, and stores vector embeddings for semantic search
  • Pydantic AI copilot agent with tools (get_tickets, get_alerts, get_tags, search_items) inspects database state before answering questions
  • Supports Docker Model Runner for local dev (compose.dev.yaml) and Defang managed model providers for deployment (compose.yaml)
  • Fixes the chat composer layout so the input/button controls keep stable dimensions after a streamed response

Architecture

Service Purpose
app FastAPI web app serving UI + API
worker Background job processor (classify + embed)
postgres pgvector-enabled PostgreSQL
redis Job queue
chat Defang managed chat model
embedding Defang managed embedding model

Closes #638

Screenshots

Playwright screenshots captured against the sample UI with successful mocked API responses, after fixing the chat composer layout. Screenshot assets are on temporary branch sam/pydantic-ai-extended-screenshots-01kr0y.

Dashboard

Pydantic AI Extended dashboard

Copilot chat

Pydantic AI Extended copilot chat

Mobile

Pydantic AI Extended mobile

Test plan

  • python3 -m compileall app
  • Playwright UI screenshot capture for dashboard, chat, and mobile states
  • docker compose -f compose.dev.yaml up --build starts all services (blocked in this workspace: docker, podman, PostgreSQL, Redis, and /var/run/docker.sock are unavailable)
  • Docker Model Runner chat + embedding services respond locally (blocked by unavailable Docker runtime)
  • Generate sample items button creates 10 tickets + 10 alerts against real local services
  • Worker classifies and embeds all items against real local services
  • Copilot chat answers questions using tool calls against real local services
  • Compose structure passes CI validation checks
  • README metadata fields present (Title, Short Description, Tags, Languages)

🤖 Generated with Claude Code

Samples Checklist

✅ All good!

Multi-service AI app with Pydantic AI, FastAPI, PostgreSQL (pgvector),
and Redis. Follows the same architecture as mastra-extended:

- FastAPI web app with copilot chat UI
- Background worker for seed generation, classification, and embedding
- Pydantic AI agent with tools for ticket/alert inspection and semantic search
- Docker Model Runner support for local development
- Defang managed Postgres, Redis, and LLM model providers

Closes #638

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simple-agent-manager simple-agent-manager Bot had a problem deploying to deploy-changed-samples May 7, 2026 09:53 Failure
@simple-agent-manager simple-agent-manager Bot had a problem deploying to deploy-changed-samples May 7, 2026 10:12 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pydantic AI Sample

1 participant