Skip to content

Open source LangGraph Platform alternative - Self-hosted AI agent backend with FastAPI and PostgreSQL. Zero vendor lock-in, full control over your agent infrastructure.

License

Notifications You must be signed in to change notification settings

ibbybuilds/aegra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

546 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Aegra banner

Aegra

Self-hosted LangSmith Deployments alternative. Your infrastructure, your rules.

PyPI API PyPI CLI CI Codecov

GitHub stars License Discord Sponsor


Aegra is a drop-in replacement for LangSmith Deployments. Use the same LangGraph SDK, same APIs, but run it on your own infrastructure with PostgreSQL persistence.

Works with: Agent Chat UI | LangGraph Studio | AG-UI / CopilotKit

πŸš€ Quick Start

Using the CLI (Recommended)

Prerequisites: Python 3.11+, Docker (for PostgreSQL)

pip install aegra-cli

# Initialize a new project β€” prompts for location, template, and name
aegra init

# Follow the printed next steps:
cd <your-project>
cp .env.example .env     # Add your OPENAI_API_KEY to .env
uv sync                  # Install dependencies
uv run aegra dev         # Start PostgreSQL + dev server

Note: Always install aegra-cli directly β€” not the aegra meta-package. The aegra package on PyPI is a convenience wrapper that does not support version pinning.

From Source

git clone https://github.com/ibbybuilds/aegra.git
cd aegra
cp .env.example .env
# Add your OPENAI_API_KEY to .env

docker compose up

Open http://localhost:8000/docs to explore the API.

Your existing LangGraph code works without changes:

from langgraph_sdk import get_client

client = get_client(url="http://localhost:8000")

assistant = await client.assistants.create(graph_id="agent")
thread = await client.threads.create()

async for chunk in client.runs.stream(
    thread_id=thread["thread_id"],
    assistant_id=assistant["assistant_id"],
    input={"messages": [{"type": "human", "content": "Hello!"}]},
):
    print(chunk)

πŸ”₯ Why Aegra?

Based on LangChain pricing as of February 2026. An enterprise tier with self-hosting is also available at custom pricing.

LangSmith Deployments Aegra
Deploy agents Local dev only (Free), paid cloud (Plus) Free, unlimited
Custom auth Not available (Free), available (Plus) Python handlers (JWT/OAuth/Firebase)
Self-hosted Enterprise only (license key required) Always (Apache 2.0)
Own database Managed only (Free/Plus), bring your own (Enterprise) Bring your own Postgres
Tracing LangSmith only Any OTLP backend (Langfuse, Phoenix, etc.)
Data residency LangChain cloud (Free/Plus), your infrastructure (Enterprise) Your infrastructure
SDK LangGraph SDK Same LangGraph SDK

✨ Features

πŸ› οΈ CLI Commands

aegra init              # Interactive β€” asks for location, template, and name
aegra init ./my-agent   # Create at path (still prompts for template)

aegra dev               # Start development server (hot reload + auto PostgreSQL)
aegra serve             # Start production server (no reload)
aegra up                # Build and start all Docker services
aegra down              # Stop Docker services

aegra version           # Show version info

πŸ“š Documentation

docs.aegra.dev β€” Full documentation with guides, API reference, and configuration.

Topic Description
Quickstart Get a running server in under 5 minutes
Configuration aegra.json format and all options
Authentication JWT, OAuth, Firebase, or custom auth handlers
Streaming 8 SSE stream modes with reconnection
Store Key-value and semantic search storage
Observability Fan-out tracing to Langfuse, Phoenix, or any OTLP backend
Deployment Docker, PaaS, and Kubernetes deployment
Migration Migrate from LangSmith Deployments

πŸ’¬ Community & Support

πŸ—οΈ Built With

🀝 Contributing

We welcome contributions! See Contributing guide and check out good first issues.

πŸ’– Support the Project

The best contribution is code, PRs, and bug reports - that's what makes open source thrive.

For those who want to support Aegra financially, whether you're using it in production or just believe in what we're building, you can become a sponsor. Sponsorships help keep development active and the project healthy.

πŸ“„ License

Apache 2.0 - see LICENSE.


⭐ Star us if Aegra helps you escape vendor lock-in ⭐

Star History Chart

About

Open source LangGraph Platform alternative - Self-hosted AI agent backend with FastAPI and PostgreSQL. Zero vendor lock-in, full control over your agent infrastructure.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 22

Languages