Self-hosted LangGraph Platform alternative. Your infrastructure, your rules.
Aegra is a drop-in replacement for LangGraph Platform. 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
Prerequisites: Docker, Python 3.11+
git clone https://github.com/ibbybuilds/aegra.git
cd aegra
cp .env.example .env
# Add your OPENAI_API_KEY to .env
docker compose upOpen 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)| Feature | LangGraph Platform | Aegra |
|---|---|---|
| Cost | $$$+ per month | Free (self-hosted) |
| Data Control | Third-party hosted | Your infrastructure |
| Vendor Lock-in | High dependency | Zero lock-in |
| Authentication | Limited options | Custom (JWT/OAuth/Firebase) |
| Database | Managed, no BYO | Bring your own Postgres |
| Tracing | LangSmith only | Your choice (Langfuse, etc.) |
| SDK Compatibility | LangGraph SDK | Same LangGraph SDK |
- Agent Protocol compliant - Works with Agent Chat UI, LangGraph Studio, CopilotKit
- Human-in-the-loop - Approval gates and user intervention points
- Streaming - Real-time responses with network resilience
- Persistent state - PostgreSQL checkpoints via LangGraph
- Configurable auth - JWT, OAuth, Firebase, or none
- Observable - Langfuse integration for tracing
- Semantic store - Vector embeddings with pgvector
- Custom routes - Add your own FastAPI endpoints
| Topic | Description |
|---|---|
| Developer Guide | Local setup, migrations, development workflow |
| Custom Routes | Add your own FastAPI endpoints |
| Semantic Store | Vector embeddings with pgvector |
| Dependencies | Shared modules for graph imports |
| Langfuse Integration | Observability and tracing |
| Production Setup | Docker deployment for production |
⚠️ Upgrading from an older version? See the PostgreSQL 18 Migration Guide.
- Discord - Chat with the community
- GitHub Discussions - Ask questions, share ideas
- GitHub Issues - Report bugs
- FastAPI - HTTP layer
- LangGraph - State management & graph execution
- PostgreSQL - Persistence & checkpoints
- pgvector - Vector embeddings
We welcome contributions! See CONTRIBUTING.md and check out good first issues.
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.
Apache 2.0 - see LICENSE.
⭐ Star us if Aegra helps you escape vendor lock-in ⭐
