Logo vun FastAPI Agent Blueprint

FastAPI Agent Blueprint

Communautéit
Mr-DooSun

FastAPI backend blueprint for AI agent apps: DDD, SQLAlchemy, Taskiq, admin UI, RAG infra, and Claude/Codex collaboration harness.

EditeurMr-DooSun
Repositoryfastapi-agent-blueprint
SproochPython
Forks
10
Stären
27
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    FastAPI Agent Blueprint stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    27 Stären an 10 Forks aus dem verlinkte Repository.

Backend foundationAI collaboration harness
Domain logic shared by HTTP APIs, background tasks, and an admin UI. Optional AI and infrastructure adapters let you start locally and add services as needed.Repository rules, task-specific skills, hooks, and review procedures guide changes to that backend across Claude Code, Codex, and Antigravity.
Run it locally · See the architectureFollow an API change · Read the shared workflow

Why this blueprint

Use it when you need multiple business domains, API + worker + admin surfaces, or a shared development workflow for teammates using AI coding tools. The backend and harness are designed together: the harness references this repo's layering, contracts, and verification commands.

Budget time to learn the domain layout, dependency-injector containers, and plan/review workflow. A small single-purpose API may not need that structure; a project needing a bundled customer frontend needs a different starting point. The harness is repository-specific, not a standalone drop-in package.

You can develop without AI tools using the manual domain tutorial. For incremental adoption and trade-offs, see the adoption guide and selection guide.

Quickstart

Prerequisites: Python >=3.12.9, uv, Git, and make. The demos also use curl and python3 on your PATH. No Docker, PostgreSQL, cloud credentials, or AI coding tool required.

Terminal 1 — start the backend:

bash
git clone https://github.com/Mr-DooSun/fastapi-agent-blueprint.git
cd fastapi-agent-blueprint
make quickstart

This installs the quickstart dependencies, creates a SQLite database, and keeps the server running on port 8001. Use a fresh checkout for evaluation: quickstart syncs the admin extra and can remove other installed extras. For development dependencies and commit hooks, use make setup when moving to the development setup.

Terminal 2 — from the same repository directory:

bash
make demo       # JWT auth, admin-realm login, user CRUD, refresh and logout
make demo-rag   # document upload, retrieval and an answer with citations

Keep terminal 1 running. Both demos check their API responses and report failure if a request does not succeed. The default RAG demo uses a keyword-based stub embedder and a templated stub answer agent; it demonstrates the pipeline without calling an external model.

These defaults are for local evaluation. Follow the development and deployment guides before using real data or exposing the service.

Backend demo: authentication and user CRUD

Backend foundation

CapabilityWhat it provides
Domain structureRouter → Service → Repository, with an optional UseCase for orchestration; automatic domain registration and reusable CRUD base classes.
API, worker, adminFastAPI endpoints, Taskiq background tasks, and NiceGUI admin pages consuming domain services.
Optional infrastructureSQL databases, DynamoDB, object storage, vector storage, and AI providers behind adapters and configuration. Start with SQLite + InMemory.
OperationsJWT/RBAC, structured logging, opt-in OpenTelemetry, AI usage accounting, and error notifications.

Worked example: document QA

The docs domain composes document upload, chunking, embedding, retrieval, and answers with citations. Its shared RAG pipeline can be reused by other domains (ADR 040).

For real model calls, install the pydantic-ai extra, configure EMBEDDING_PROVIDER + EMBEDDING_MODEL and LLM_PROVIDER + LLM_MODEL, and supply the selected providers' credentials. See the configuration reference for optional extras and settings; the RAG walkthrough shows the flow.

HTTP, worker, and admin interfaces are implemented. The MCP server interface is planned, not part of the runnable backend today.

AI collaboration harness

The harness helps contributors work within the same backend conventions:

CapabilityWhat it provides
Shared rulesAGENTS.md and shared references define architecture, contracts, security constraints, and the development workflow.
Task-specific skillsGuides for domains, APIs, worker tasks, admin pages, migrations, testing, review, and documentation sync.
Workflow boundariesPlanning and execution are separate steps. Scope changes, missing verification, and completion checks have explicit handling.
Checks and reviewCommit/CI checks inspect deterministic rules; reviews assess behavior, architectural fit, and documentation drift.

Worked example: add an API to an existing domain

For a request such as “add a filtered list endpoint to the order domain,” the workflow is:

StepContributor and agent actions
Frame and planClarify the contract and affected layers with /plan-feature (Claude) or $plan-feature (Codex). Review the resulting execution packet.
Start executionThe contributor explicitly invokes /execute-plan or $execute-plan with that packet. The executor routes API implementation through the add-api skill.
Implement and verifyReuse the existing layer patterns, add relevant tests, and run the packet's verification commands. Surface unplanned capability gaps before expanding the work.
Review and syncReview the diff; reconcile affected documentation with sync-guidelines when needed. Record verification and any unresolved items before PR completion.

This is an illustrative workflow, not a command that runs every step automatically. Human decisions remain part of the process.

What is enforced? Configured pre-commit/CI checks block detected violations such as prohibited imports, broken documentation links, or shared-file language policy failures. Workflow reminders are advisory in many cases. For example, the plan-to-execution gate blocks matching source edits in Claude, while Codex receives a Stop-time advisory. Tool adapters share policy but do not provide identical enforcement. See the operating model for current coverage and exceptions.

Domain scaffolding is another supported task:

Domain scaffolding through the new-domain skill

Set up Claude Code or Codex · Antigravity harness · Shared rules · Manual development path

Architecture at a glance

Every domain separates Interface, Domain, Infrastructure, and optional Application code. Runtime CRUD follows Router → Service → Repository; dependency arrows below describe imports, not request execution order.

Request schemas can pass directly to services when fields match. Model-to-DTO conversion belongs in repositories. Detailed write/read flows and storage variants are in the architecture guide (SVG versions).

Learn more

Roadmap

See the full roadmap and issue tracker.

Contributing

See CONTRIBUTING.md for setup and the PR workflow. The examples and good first issues are entry points for new contributors.

License

MIT — free for commercial use, modification, and distribution.


Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "mr-doosun-fastapi-agent-blueprint": {
      "command": "",
      "args": []
    }
  }
}

FastAPI Agent Blueprint MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal FastAPI Agent Blueprint verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

FastAPI Agent Blueprint als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu FastAPI Agent Blueprint an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mr-doosun-fastapi-agent-blueprint": {
      "command": "npx",
      "args": [
        "-y",
        "fastapi-agent-blueprint"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu FastAPI Agent Blueprint. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu FastAPI Agent Blueprint.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat FastAPI Agent Blueprint?
FastAPI Agent Blueprint
Jo. Ech hunn et gelies.
Dat hunn ech mat FastAPI Agent Blueprint fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server FastAPI Agent Blueprint benotzt?

FastAPI Agent Blueprint ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech FastAPI Agent Blueprint MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir FastAPI Agent Blueprint mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat FastAPI Agent Blueprint MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann FastAPI Agent Blueprint verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech FastAPI Agent Blueprint MCP mat TypingMind?

FastAPI Agent Blueprint leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt FastAPI Agent Blueprint MCP an TypingMind zur Verfügung?

FastAPI Agent Blueprint stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir FastAPI Agent Blueprint MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann FastAPI Agent Blueprint eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇