Metadata-Version: 2.4
Name: fast-agent-stack
Version: 0.1.0a1
Summary: An opinionated FastAPI framework for AI/agent production applications
Project-URL: Homepage, https://github.com/vkanwade/fast-agent-stack
Project-URL: Repository, https://github.com/vkanwade/fast-agent-stack
Project-URL: Documentation, https://fast-agent-stack.readthedocs.io
Project-URL: Changelog, https://github.com/vkanwade/fast-agent-stack/blob/main/CHANGELOG.md
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: alembic>=1.13
Requires-Dist: copier>=9.0
Requires-Dist: fastapi[standard]>=0.138.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: sqlalchemy[asyncio]>=2.0
Requires-Dist: typer>=0.12
Provides-Extra: admin
Requires-Dist: itsdangerous>=2.1; extra == 'admin'
Requires-Dist: sqladmin>=0.16; extra == 'admin'
Provides-Extra: ai-full
Requires-Dist: aioboto3>=12; extra == 'ai-full'
Requires-Dist: aiofiles>=23; extra == 'ai-full'
Requires-Dist: anthropic>=0.25; extra == 'ai-full'
Requires-Dist: asyncpg>=0.29; extra == 'ai-full'
Requires-Dist: httpx>=0.27; extra == 'ai-full'
Requires-Dist: litellm>=1.30; extra == 'ai-full'
Requires-Dist: openai>=1.0; extra == 'ai-full'
Requires-Dist: pgvector>=0.2; extra == 'ai-full'
Requires-Dist: qdrant-client>=1.7; extra == 'ai-full'
Provides-Extra: all
Requires-Dist: aioboto3>=12; extra == 'all'
Requires-Dist: aiofiles>=23; extra == 'all'
Requires-Dist: aiosmtplib>=3; extra == 'all'
Requires-Dist: anthropic>=0.25; extra == 'all'
Requires-Dist: asyncpg>=0.29; extra == 'all'
Requires-Dist: dramatiq[redis]>=1.15; extra == 'all'
Requires-Dist: fastapi-redis-sdk>=0.7; extra == 'all'
Requires-Dist: httpx>=0.27; extra == 'all'
Requires-Dist: itsdangerous>=2.1; extra == 'all'
Requires-Dist: litellm>=1.30; extra == 'all'
Requires-Dist: openai>=1.0; extra == 'all'
Requires-Dist: openpyxl>=3.1; extra == 'all'
Requires-Dist: opentelemetry-api>=1.20; extra == 'all'
Requires-Dist: opentelemetry-exporter-otlp>=1.20; extra == 'all'
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.64b0; extra == 'all'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'all'
Requires-Dist: periodiq>=0.9; extra == 'all'
Requires-Dist: pgvector>=0.2; extra == 'all'
Requires-Dist: pwdlib[argon2]>=0.3; extra == 'all'
Requires-Dist: pyjwt[crypto]>=2.8; extra == 'all'
Requires-Dist: pymupdf>=1.24; extra == 'all'
Requires-Dist: python-docx>=1.1; extra == 'all'
Requires-Dist: qdrant-client>=1.7; extra == 'all'
Requires-Dist: sqladmin>=0.16; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.25; extra == 'anthropic'
Provides-Extra: auth-jwt
Requires-Dist: fastapi-redis-sdk>=0.7; extra == 'auth-jwt'
Requires-Dist: pwdlib[argon2]>=0.3; extra == 'auth-jwt'
Requires-Dist: pyjwt[crypto]>=2.8; extra == 'auth-jwt'
Provides-Extra: auth-session
Requires-Dist: fastapi-redis-sdk>=0.7; extra == 'auth-session'
Requires-Dist: pwdlib[argon2]>=0.3; extra == 'auth-session'
Provides-Extra: bedrock
Requires-Dist: aioboto3>=12; extra == 'bedrock'
Provides-Extra: caching
Requires-Dist: fastapi-redis-sdk>=0.7; extra == 'caching'
Provides-Extra: db-mysql
Requires-Dist: aiomysql>=0.2; extra == 'db-mysql'
Provides-Extra: db-postgres
Requires-Dist: asyncpg>=0.29; extra == 'db-postgres'
Provides-Extra: db-sqlite
Requires-Dist: aiosqlite>=0.19; extra == 'db-sqlite'
Provides-Extra: email-smtp
Requires-Dist: aiosmtplib>=3; extra == 'email-smtp'
Provides-Extra: embedding-bedrock
Requires-Dist: aioboto3>=12; extra == 'embedding-bedrock'
Provides-Extra: embedding-local
Requires-Dist: fastembed>=0.8; extra == 'embedding-local'
Provides-Extra: embedding-openai
Requires-Dist: openai>=1.0; extra == 'embedding-openai'
Provides-Extra: extract-docx
Requires-Dist: python-docx>=1.1; extra == 'extract-docx'
Provides-Extra: extract-pdf
Requires-Dist: pymupdf>=1.24; extra == 'extract-pdf'
Provides-Extra: extract-xlsx
Requires-Dist: openpyxl>=3.1; extra == 'extract-xlsx'
Provides-Extra: litellm
Requires-Dist: litellm>=1.30; extra == 'litellm'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Provides-Extra: rate-limit
Requires-Dist: fastapi-redis-sdk>=0.7; extra == 'rate-limit'
Provides-Extra: reranker-ollama
Requires-Dist: httpx>=0.27; extra == 'reranker-ollama'
Provides-Extra: reranker-openai
Requires-Dist: httpx>=0.27; extra == 'reranker-openai'
Provides-Extra: scheduler
Requires-Dist: periodiq>=0.9; extra == 'scheduler'
Provides-Extra: secrets-aws
Requires-Dist: boto3>=1.34; extra == 'secrets-aws'
Provides-Extra: secrets-gcp
Requires-Dist: google-cloud-secret-manager>=2.20; extra == 'secrets-gcp'
Provides-Extra: storage-local
Requires-Dist: aiofiles>=23; extra == 'storage-local'
Provides-Extra: storage-minio
Requires-Dist: aioboto3>=12; extra == 'storage-minio'
Provides-Extra: storage-s3
Requires-Dist: aioboto3>=12; extra == 'storage-s3'
Provides-Extra: tasks
Requires-Dist: dramatiq[redis]>=1.15; extra == 'tasks'
Provides-Extra: tracing
Requires-Dist: opentelemetry-api>=1.20; extra == 'tracing'
Requires-Dist: opentelemetry-exporter-otlp>=1.20; extra == 'tracing'
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.64b0; extra == 'tracing'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'tracing'
Provides-Extra: vector-opensearch
Requires-Dist: opensearch-py[async]>=2.3; extra == 'vector-opensearch'
Provides-Extra: vector-pgvector
Requires-Dist: asyncpg>=0.29; extra == 'vector-pgvector'
Requires-Dist: pgvector>=0.2; extra == 'vector-pgvector'
Provides-Extra: vector-qdrant
Requires-Dist: qdrant-client>=1.7; extra == 'vector-qdrant'
Provides-Extra: vector-weaviate
Requires-Dist: weaviate-client>=4; extra == 'vector-weaviate'
Description-Content-Type: text/markdown

# fast-agent-stack

[![PyPI](https://img.shields.io/pypi/v/fast-agent-stack)](https://pypi.org/project/fast-agent-stack/)
[![Python](https://img.shields.io/pypi/pyversions/fast-agent-stack)](https://pypi.org/project/fast-agent-stack/)
[![CI](https://github.com/vkanwade/fast-agent-stack/actions/workflows/ci.yml/badge.svg)](https://github.com/vkanwade/fast-agent-stack/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Production infrastructure for AI agent applications, built on FastAPI.**

fast-agent-stack gives you auth, database, vector search, background tasks, rate limiting, observability, and storage out of the box. Bring your own agent framework (Strands, Pydantic AI, LangGraph) or use the built-in `@app.agent()` for simple cases.

---

## Quick Start

```bash
mkdir myproject && cd myproject
uv venv && source .venv/bin/activate
uv pip install fast-agent-stack

fas new myproject --preset agent
uv pip install -r pyproject.toml
fas migrate
fas dev
```

Visit `http://localhost:8000/docs` to see the interactive API.

---

## Installation

```bash
# Core only
pip install fast-agent-stack

# With extras (mix and match)
pip install "fast-agent-stack[auth-jwt,db-postgres,vector-qdrant]"

# Full AI stack
pip install "fast-agent-stack[ai-full]"
```

---

## Presets

Pick a preset and get a production-ready project in seconds:

| Preset | What you get |
|--------|-------------|
| `minimal` | FastAPI app, SQLAlchemy, health checks, CLI |
| `standard` | + JWT auth, SQLAdmin, Docker |
| `full` | + rate limiting, background tasks, email, observability |
| `agent` | + LLM backends, vector store, RAG pipeline, streaming |

```bash
fas new myproject --preset standard
```

---

## Features

### Infrastructure
- SQLAlchemy async + Alembic migrations
- Redis/Valkey: auth, rate limiting, response caching
- Background tasks (Dramatiq) + scheduler (Periodiq)
- Storage: S3, MinIO, local filesystem
- OpenTelemetry tracing (Jaeger backend)
- AWS / GCP secrets managers

### Auth
- JWT + session auth backends, pluggable via settings
- RBAC: users, groups, permissions, API keys
- Redis JTI denylist, email verification, password reset
- SQLAdmin UI (optional)

### Vector Search & RAG
- Vector stores: Qdrant, pgvector, OpenSearch, Weaviate
- Embedding backends: Bedrock, OpenAI, fastembed (local)
- RAG pipeline: chunk, embed, store / retrieve
- Document extraction: PDF, DOCX, XLSX, EML

### AI / Agents
- Built-in `@app.agent()` decorator for simple single-agent endpoints
- LLM backends: AWS Bedrock, OpenAI, Anthropic, LiteLLM proxy
- `get_llm(settings)` factory for one-line backend resolution
- Framework integration guides for [Strands Agents](docs/guides/framework-integration/strands-agents.md) and [Pydantic AI](docs/guides/framework-integration/pydantic-ai.md)

---

## Bring Your Own Agent Framework

fast-agent-stack's built-in `@app.agent()` covers simple cases (like FastAPI's `BackgroundTasks`). For serious agentic work, bring your own framework and use fast-agent-stack for the infrastructure:

```python
# myproject/ai/agents/chat.py
from strands import Agent
from strands.models.litellm import LiteLLMModel

from myproject.ai.tools.search import search_docs
from myproject.settings import get_settings

_settings = get_settings()

def build_chat_agent():
    model = LiteLLMModel(
        model_id=f"openai/{_settings.llm_model}",
        params={"api_key": _settings.llm_api_key, "api_base": _settings.llm_base_url},
    )
    return Agent(model=model, tools=[search_docs])
```

```python
# myproject/routes.py
from fastapi.responses import StreamingResponse

@router.post("/agents/chat")
async def chat(body: ChatRequest) -> StreamingResponse:
    return StreamingResponse(stream_chat(body.message), media_type="text/event-stream")
```

See the [Strands Agents guide](docs/guides/framework-integration/strands-agents.md) or [Pydantic AI guide](docs/guides/framework-integration/pydantic-ai.md) for full working examples.

---

## Extras

```toml
# Auth
fast-agent-stack[auth-jwt]         # JWT backend
fast-agent-stack[auth-session]     # Session backend

# Database drivers
fast-agent-stack[db-postgres]      # asyncpg
fast-agent-stack[db-sqlite]        # aiosqlite
fast-agent-stack[db-mysql]         # aiomysql

# LLM backends
fast-agent-stack[anthropic]        # Anthropic SDK
fast-agent-stack[openai]           # OpenAI SDK
fast-agent-stack[bedrock]          # aioboto3 (AWS Bedrock)
fast-agent-stack[litellm]          # LiteLLM proxy

# Vector stores
fast-agent-stack[vector-qdrant]
fast-agent-stack[vector-pgvector]
fast-agent-stack[vector-opensearch]
fast-agent-stack[vector-weaviate]

# Background tasks
fast-agent-stack[tasks]            # Dramatiq + Redis broker

# Observability
fast-agent-stack[tracing]          # OpenTelemetry + Jaeger

# Full AI bundle
fast-agent-stack[ai-full]
```

---

## CLI

| Command | Description |
|---------|-------------|
| `fas new <name>` | Scaffold a new project |
| `fas dev` | Dev server (127.0.0.1, auto-reload) |
| `fas run` | Production server (0.0.0.0, multi-worker) |
| `fas migrate` | Apply all migrations |
| `fas makemigrations` | Generate migration from model changes |
| `fas worker <module>` | Start Dramatiq worker |
| `fas scheduler <module>` | Start Periodiq scheduler |
| `fas createsuperuser` | Create a superuser account |
| `fas version` | Print installed version |

`fastagentstack` also works as the full-length alias.

---

## Documentation

- [Tutorial](docs/tutorial/index.md) - Build a Document Q&A app step by step
- [Framework Integration Guides](docs/guides/framework-integration/index.md) - Strands Agents, Pydantic AI
- [Getting Started](docs/getting-started.md)
- [Authentication & Authorization](docs/auth.md)
- [AI Module & Agents](docs/ai.md)
- [RAG Pipeline](docs/rag.md)
- [Storage & Extraction](docs/storage.md)
- [Background Tasks & Scheduling](docs/tasks.md)
- [Rate Limiting & Observability](docs/ratelimit.md)
- [Deployment](docs/deployment.md)
- [Custom Backends](docs/custom-backends.md)
- [Configuration Reference](docs/configuration.md)

---

## License

MIT
