L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Développement · SKILL.md

agentic-ai-dev

agentic-ai-dev

This skill provides patterns and templates for building production AI agents with Python 3.14, LangChain v1.2.8, LangGraph v1.0.7, and FastAPI 0.135.2. Use when creating AI agents, RAG systems, graph workflows, tools, memory systems, or agent tests.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: agentic-ai-dev description: "This skill provides patterns and templates for building production AI agents with Python 3.14, LangChain v1.2.8, LangGraph v1.0.7, and FastAPI 0.135.2. Use when creating AI agents, RAG systems, graph workflows, tools, memory systems, or agent tests." allowed-tools: Bash, Read, Write, Edit metadata: triggers: AI agent, LangChain, LangGraph, RAG system, graph workflow, FastAPI, Python 3.14, LangGraph agent, memory system, agent test related-skills: agentic-ai-coding-standard, python-dev, mcp-builder domain: backend role: specialist scope: implementation output-format: code last-reviewed: "2026-03-14"

Iron Law

NO AGENT GRAPH WITHOUT AN ITERATION LIMIT AND A HUMAN-IN-THE-LOOP CHECKPOINT — unbounded loops and silent runaway agents are production incidents

Agentic AI Development Skill — Python 3.14 + LangChain + LangGraph + FastAPI

Quick Scaffold

uv init my-agent-service && cd my-agent-service
uv add "langchain-core>=1.2.8" "langchain-anthropic>=1.3.0" "langchain-openai>=1.1.0" "langgraph>=1.0.7" \
  "fastapi>=0.135.2" "uvicorn[standard]" pydantic pydantic-settings \
  langsmith prometheus-client structlog httpx asyncpg \
  "langgraph-checkpoint-postgres>=3.0.0"
uv add --dev pytest pytest-asyncio httpx ruff mypy

Process

  1. Scaffold — uv init + install dependencies
  2. Configure — core/config.py with pydantic-settings, .env, structured logging
  3. Define State — TypedDict with Annotated[list, add_messages] for each agent
  4. Build Graph — StateGraph with typed nodes, conditional edges, checkpointing
  5. Define Tools — @tool with docstrings, Pydantic input schemas, error handling
  6. Add Memory — Checkpointing (PostgresSaver), semantic memory (vector store)
  7. Add Guardrails — Input validation, prompt injection detection, output validation
  8. Expose API — FastAPI routes for invoke/stream with thread_id propagation
  9. Write Tests — Basic invoke, tool usage, iteration limit, error recovery, RAG quality
  10. Deploy — Docker multi-stage, gunicorn + uvicorn, health checks, Prometheus

Key Patterns

PatternImplementationReference
Agent GraphsStateGraph + typed nodes + conditional edgesagentic-templates-basic.md
Tools@tool + docstring + Pydantic input + try/exceptagentic-templates-tools.md
LLM BindingFactory function per provider, .bind_tools()agentic-llm-routing.md
RoutingCommand(goto=...) pattern (LangGraph)agentic-templates-advanced.md
CheckpointingPostgresSaver (prod) / MemorySaver (test)agentic-memory-systems.md
Streamingastream() + stream_mode + FastAPI SSEagentic-streaming-hitl.md
Human-in-the-Loopinterrupt_before + approval nodeagentic-streaming-hitl.md
RAGEmbeddings → Vector Store → Retriever → Rerankeragentic-templates-rag.md
Guardrails12-layer pipeline: input → process → outputagentic-guardrails-security.md
Structured Output.with_structured_output(PydanticModel)agentic-prompt-engineering.md
Error RecoveryRetry node + fallback model + graceful degradationagentic-templates-resilience.md
Configpydantic-settings + fail-fast validatorsagentic-config-project.md
Caching4-tier Q1→Q2→Q3→L3 with backfill; @cached_tool decoratoragentic-caching-patterns.md

Conventions & Rules

For package layout, LangGraph rules, and FastAPI integration rules, read reference/agentic-conventions.md

Documentation Sources

Before generating code, consult these sources for current syntax and APIs:

SourceURL / ToolPurpose
LangGraphhttps://langchain-ai.github.io/langgraph/llms-full.txtStateGraph, nodes, edges, checkpointing APIs
Pydantic v2https://docs.pydantic.dev/latest/llms-full.txtModel validation, settings, Field constraints
FastAPI / LangChainContext7 MCPLatest LangChain tools, FastAPI patterns

Reference Files

FileContentWhen to Use
agentic-agent-variant-ladder.mdCapability tier pattern, deterministic shadow agents, NDJSON replayMulti-agent architecture
agentic-config-project.mdpyproject.toml, .env, config, Docker, ruff/mypyProject setup
agentic-templates-core.mdFastAPI app, main.py, routes, middleware, base stateCreating API layer
agentic-templates-basic.mdReAct Agent, Multi-Agent Collaborative patternsBuilding basic agents
agentic-templates-advanced.mdHierarchical Supervisor, Command, Sub-Graph patternsBuilding complex agents
agentic-templates-resilience.mdError Recovery Agent, key design decisionsAgent error handling
agentic-templates-rag.md6 RAG architectures + document ingestion pipelineBuilding RAG systems
agentic-templates-tools.md@tool patterns, MCP integration, retry/timeoutDefining agent tools
agentic-guardrails-security.md12-layer security frameworkAdding safety layers
agentic-memory-systems.md7-layer memory hierarchy, practical implementationsAdding memory to agents
agentic-streaming-hitl.mdStreaming + Human-in-the-Loop patternsReal-time responses, approval flows
agentic-llm-routing.mdMulti-provider routing, cost calculation, fallback chainsMulti-model setups
agentic-observability.mdLangSmith, Prometheus, structured loggingMonitoring and debugging
agentic-testing.mdAgent testing patterns, mocks, fixturesWriting agent tests
agentic-deployment.mdDocker, docker-compose, production configDeploying agents
agentic-debugging.mdDebugging playbook, common issuesTroubleshooting agents
agentic-cost-optimization.mdCost management, budget caps, prompt optimizationReducing LLM costs
agentic-prompt-engineering.mdAdvanced prompting, structured output, templatesWriting better prompts
agentic-error-handling.mdAgent, tool, LLM provider, and API error handling patternsError handling in agents
agentic-review-checklist.mdAgentic AI review checklist (used by agentic-ai-reviewer agent)Code reviews
agentic-prompt-optimization.mdConstitutional AI, Tree-of-Thoughts, model-specific templates (Claude/Gemini/GPT), prompt versioning registry, canary rollout, LLM-as-judgeOptimizing prompt quality; multi-model deployments; production prompt lifecycle
llm-judge-advanced.mdProduction LLM-as-Judge: bias taxonomy (position, length, self-enhancement), position swap protocol, rubric generation, PoLL ensemble, hierarchical evalEvaluating agent outputs with reliability; high-stakes eval decisions
agentic-caching-patterns.md4-tier cache (Q1 LRU→Q2 Redis→Q3 semantic→L3 Anthropic), backfill, @cached_tool decorator, cache key generation, Prometheus metricsAdding caching to LangGraph agents
agentic-makefile-patterns.md40+ Makefile commands for setup, testing, RAG, memory, evaluation, Docker, observability — reference patterns for agentic AI servicesSetting up developer workflow automation

Common Commands

uvicorn src.main:app --reload                          # Run dev server (hot reload)
pytest -q                                              # Run tests (quiet output)
pytest -q --cov=src --cov-report=term-missing          # Tests with coverage
ruff check --fix .                                     # Lint and auto-fix
ruff format .                                          # Format code
mypy src/                                              # Type check

Error Handling

For error handling patterns and code examples, read reference/agentic-error-handling.md

LLM provider errors: Use retry with exponential backoff + fallback model chain. Never let provider errors crash the graph.

Tool execution errors: Wrap all @tool functions in try/except. Return structured error messages the LLM can reason about.

Graph infinite loops: Always include iteration_count in state and check it in the routing function.

Post-Code Review

After writing agentic AI code, dispatch these reviewer agents:

  • agentic-ai-reviewer — graph correctness, guardrails, iteration limits, cost efficiency
  • security-reviewer — tool input validation, prompt injection defense
Skills enregistrées