Below you will find pages that utilize the taxonomy term “Fastapi”
Guides
A LangGraph Agent with Tools, Guardrails, and Memory
A LangGraph agent with local function tools, guardrails, memory, human-in-the-loop, and optional MCP server connections.
Features
- Local tools: filesystem, network, web search, math, bash
- Optional MCP server connections (math, perf)
- Configurable LLM providers: Ollama (default), OpenAI, Google Gemini, Anthropic, Microsoft Azure, Meta, DeepSeek, Mistral, xAI, OpenRouter
- Conversation memory via LangGraph checkpointing (SQLite)
- Guardrails: input validation, LLM-as-judge, output PII redaction, bash command denylist
- Human-in-the-loop tool call confirmation
- Graceful error handling for LLM connection failures
- HTTP API via FastAPI with streaming support
- Playground UI at
/playground - React frontend under
frontend/ - LangSmith tracing support
Getting Started
uv sync
./run-cli-agent.sh
For a different LLM provider:
Guides
A WebSocket Client/Server Skeleton Using FastAPI
A production-ready WebSocket client/server app using FastAPI.
docker run --rm --name websocket-python-example -p 8080:8080 -it jecklgamis/websocket-python-example:main
Tech Stack
- FastAPI - async web framework with WebSocket support
- websockets - WebSocket client library
- Pydantic v2 - validation and settings management
- Docker - containerized deployment (Python 3.12-slim)
- Helm - Kubernetes deployment chart
- Ruff - linting and formatting
- pytest - testing with async support
Project Structure
├── app/
│ ├── __init__.py # Global logging init (INFO level)
│ ├── main.py # FastAPI application entry point
│ ├── config.py # Environment-specific settings (dev/test/prod)
│ └── routers/ # API route handlers
│ └── websocket.py # WebSocket /ws endpoint
├── tests/ # Test suite
├── deployment/
│ └── k8s/helm/ # Helm chart and deploy Makefile
├── websocket_client.py # WebSocket client
├── run-server.sh # Start the server
├── run-client.sh # Start the client
├── Dockerfile
├── Makefile
└── pyproject.toml
Getting Started
Prerequisites
# Clone the repository
git clone git@github.com:jecklgamis/websocket-python-example.git && cd websocket-python-example
# Install dependencies
make install-deps
# Start the dev server (uses .env.dev by default)
make run-dev
The server will be available at http://localhost:8080. This will reload on file changes.
