aegra-api
Aegra core API - Self-hosted Agent Protocol server
What it is and what it does
Aegra API is a FastAPI-based server that hosts and executes AI agent graphs defined using LangGraph, providing a self-hosted alternative to vendor-locked services. It implements the Agent Protocol standard, making agents compatible with tools like Agent Chat UI and LangGraph Studio. The package handles agent lifecycle management—creating assistants from graph definitions, managing conversation threads, executing runs synchronously or with streaming, and canceling in-flight executions. It includes built-in support for human-in-the-loop approval workflows and scheduled cron job triggers with timezone awareness and multi-instance safety.
The server stores agent state and conversation history in PostgreSQL, offers semantic search via a vector store, and integrates observability through OpenTelemetry with exporters for tracing and metrics. It requires substantial infrastructure—a PostgreSQL database, Redis for caching, and configured LangGraph agent graphs—making it suited for teams deploying agents on their own servers rather than using managed platforms. The dependency stack includes SQLAlchemy for ORM, Pydantic for validation, and Prometheus instrumentation for monitoring.
Use it for:
- Deploy proprietary AI agents on internal infrastructure without reliance on third-party agent hosting platforms.
- Build multi-turn conversation systems with thread-based state management and human approval gates.
- Schedule recurring agent tasks (e.g., daily reports, periodic data processing) with cron-like triggers.
- Integrate LangGraph workflows into production systems via REST API with streaming response support.
- Monitor and trace agent execution with OpenTelemetry observability and Prometheus metrics.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Aegra API is a self-hosted Agent Protocol server that runs AI agent graphs on your own infrastructure, compatible with LangGraph SDK and providing streaming, human-in-the-loop workflows, and scheduled cron job execution.
Yes, if you need to self-host LangGraph agents and have PostgreSQL infrastructure available. The package is actively maintained, has no known vulnerabilities, and provides a complete Agent Protocol implementation with production-ready features (streaming, cron jobs, observability). Install friction is low. The substantial dependency footprint and requirement for PostgreSQL setup are expected trade-offs for a self-hosted server, not drawbacks. Not suitable if you prefer managed agent hosting or lack infrastructure to run PostgreSQL.
Install
aegra-api on PyPI
pip
pip install aegra-apiuv
uv add aegra-apipoetry
poetry add aegra-apiInstalling aegra-api
Before you install
Low install friction with a pure Python wheel. Active maintenance: released 2 days ago with 1134 repository stars. Requires 22 runtime dependencies including FastAPI, LangGraph, PostgreSQL drivers, and OpenTelemetry observability stack—a substantial but typical footprint for a production agent server.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and redistribution with minimal restrictions, suitable for self-hosted deployments in both open-source and proprietary contexts.
Quickstart
# Install
pip install aegra-api
# Set environment variables
export POSTGRES_USER=aegra
export POSTGRES_PASSWORD=aegra_secret
export POSTGRES_HOST=localhost
export POSTGRES_DB=aegra
# Run migrations and start
alembic upgrade head
uvicorn aegra_api.main:app --port 2026 --reload
Requires PostgreSQL database, Python 3.12+, and LangGraph graph definitions in aegra.json configuration file.
Verify before relying
- Whether the package works with Python versions beyond 3.12 despite 'supports_current' classifier.
- Performance characteristics and scalability limits for concurrent agent runs.
- Specific observability integrations beyond LANGFUSE and PHOENIX mentioned in docs.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 22 — alembic, asgi-correlation-id, asyncpg, croniter, fastapi, greenlet, langgraph-checkpoint-postgres, langgraph-sdk, langgraph, openinference-instrumentation-langchain, opentelemetry-api, opentelemetry-exporter-otlp, opentelemetry-sdk, prometheus-fastapi-instrumentator, psycopg, pydantic-settings, pydantic, redis, sqlalchemy, sse-starlette, structlog, uvicorn |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 85,991/month — #13,890 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aegra_api-0.10.0-py3-none-any.whl
Keywords: agent-protocol, agents, fastapi, langgraph, llm
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
langgraph-sdkPython SDK for building and deploying agentic…
permissive · top 1,000 on PyPI
ag-ui-langgraphBridges LangGraph agent workflows to the AG-UI…
permissive · top 15,000 on PyPI
langgraphLangGraph is a low-level orchestration…
permissive · top 1,000 on PyPI
langgraph-apiRuns a local development server for LangGraph…
unclear · top 5,000 on PyPI
uipath-langchainBuilds and deploys LangGraph agents to UiPath…
unclear · top 5,000 on PyPI
langgraph-swarmBuilds multi-agent swarm systems where…
permissive · top 15,000 on PyPI
langgraph-checkpoint-awsProvides AWS-based persistence backends for…
permissive · top 15,000 on PyPI
ag_ui_adkBridges Google ADK agents to the AG-UI…
permissive · top 15,000 on PyPI
agent-framework-ag-uiConnects Agent Framework agents and workflows…
permissive · top 15,000 on PyPI
langgraph-checkpoint-redisProvides Redis-backed checkpoint storage and…
permissive · top 5,000 on PyPI