skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
docs.aegra.dev184 installs

aegra

Use when deploying LangGraph agents to production, building multi-turn conversational AI systems, managing agent state and persistence, implementing human-in-the-loop workflows, or setting up self-hosted agent infrastructure with authentication and observability.

How do I install this agent skill?

npx skills add https://docs.aegra.dev --skill aegra
view source ↗

Is this agent skill safe to install?

  • Socketpass

    No alerts

What does this agent skill do?

Aegra Skill

Product summary

Aegra is an open-source, self-hosted Agent Protocol server for running LangGraph agents on your own infrastructure. It provides production-ready features including persistent state via PostgreSQL, real-time streaming with Server-Sent Events, human-in-the-loop approval gates, configurable authentication (JWT/OAuth/Firebase), semantic search with pgvector, and deployment to Docker, PaaS, or Kubernetes. Use the LangGraph SDK you already know — Aegra is a drop-in replacement for LangSmith Deployments with zero code changes.

Key files and commands:

  • aegra.json — Configuration file defining graphs, auth, HTTP routes, store settings, and checkpointer behavior
  • aegra dev — Start development server with hot reload and managed PostgreSQL
  • aegra serve — Start production server (requires external PostgreSQL)
  • aegra up — Start full stack in Docker (PostgreSQL + Redis + app)
  • .env — Environment variables for API keys, database, and Redis configuration

Primary docs: https://docs.aegra.dev

When to use

Reach for this skill when:

  • Deploying agents to production — You need a self-hosted server for LangGraph graphs with persistence and authentication
  • Building multi-turn conversations — You're creating chatbots or assistants that maintain state across interactions
  • Implementing approval workflows — You need human-in-the-loop gates where users approve or edit agent actions before execution
  • Managing agent state — You need to inspect, update, or replay conversations from specific checkpoints
  • Setting up authentication — You're adding JWT, OAuth, Firebase, or custom auth to control who can use your agents
  • Streaming responses — You need real-time token-by-token output or tool call updates to clients
  • Scaling horizontally — You're deploying multiple instances with Redis for job dispatch and crash recovery
  • Observability — You need to trace agent execution to OpenTelemetry backends (Langfuse, Phoenix, etc.)

Quick reference

CLI commands

CommandPurposeWhen to use
aegra initCreate new projectStarting a new agent project
aegra devDev server with hot reloadLocal development
aegra serveProduction serverPaaS, Docker, Kubernetes, bare metal
aegra upFull Docker stackSelf-hosted production with PostgreSQL + Redis
aegra downStop Docker servicesShutting down local stack
aegra db upgradeApply migrationsMulti-pod deployments before rolling out

Configuration sections in aegra.json

SectionPurposeExample
graphsRegister LangGraph agents{"agent": "./src/graph.py:graph"}
authEnable authentication{"path": "./auth.py:auth"}
httpCustom FastAPI routes{"app": "./routes.py:app"}
storeSemantic search with embeddings{"index": {"dims": 1536, "embed": "openai:text-embedding-3-small"}}
checkpointerThread TTL and durability{"ttl": {"strategy": "delete", "default_ttl": 43200}}

Graph registration patterns

{
  "graphs": {
    "static_graph": "./path/graph.py:compiled_graph",
    "factory_graph": "./path/graph.py:graph_factory"
  }
}
  • Static graph — builder.compile() result, cached once at startup
  • Factory function — Callable accepting config and/or ServerRuntime, called per-request for user-specific customization

Environment variables (key ones)

VariablePurpose
DATABASE_URLPostgreSQL connection (production)
POSTGRES_*Individual database fields (dev)
REDIS_BROKER_ENABLEDEnable Redis for job dispatch (production)
REDIS_URLRedis connection string
AEGRA_CONFIGPath to custom config file
AEGRA_CHECKPOINT_DURABILITYDefault checkpoint mode: sync, async, or exit
AEGRA_THREAD_TTLThread expiry in minutes
RUN_MIGRATIONS_ON_STARTUPAuto-run migrations (set false for multi-pod)

Decision guidance

When to use each deployment command

ScenarioCommandWhy
Local developmentaegra devStarts PostgreSQL automatically, hot reload, simplest setup
Self-hosted productionaegra upFull stack in Docker, includes Redis for scaling
PaaS (Railway, Render, Fly.io)aegra serveNo Docker needed, you provide PostgreSQL + Redis
Kubernetesaegra serve in pod specStateless, works with managed databases
Single-instance productionaegra serve with REDIS_BROKER_ENABLED=falseSimpler, no Redis needed

When to use static vs factory graphs

NeedUseExample
Simple agent, same for all usersStatic graphbuilder.compile()
Customize tools per userFactory with ServerRuntimeCheck runtime.user.permissions to add/remove tools
Manage resources (MCP, DB connections)Factory with async context managerAllocate resources at factory time, release on cleanup
Access user data in nodesRuntime[T] parameter on nodeReceive typed context via runtime.context

When to use each stream mode

ModeUse whenExample
valuesYou need full state snapshotsUpdating UI with complete conversation state
updatesYou only want state deltasEfficient incremental updates
messagesYou're building a chat UIToken-by-token LLM output
customYou emit domain-specific dataProgress updates, intermediate results
eventsYou need fine-grained tracingDebugging, detailed execution logs

Checkpoint durability modes

ModeCheckpoint timingRecovery behaviorUse when
syncAfter every stepResumes from last completed stepYou need precise recovery, can tolerate latency
async (default)Background after each stepResumes from last finished checkpointStandard production use
exitOnce at run endRestarts from thread's pre-run stateHigh-volume runs, no mid-run recovery needed

Workflow

1. Set up a new Aegra project

pip install aegra-cli
aegra init
# Choose template (simple-chatbot or react-agent)
cd <project>
cp .env.example .env
# Add OPENAI_API_KEY to .env
uv sync
uv run aegra dev

Visit http://localhost:2026/docs to explore the API.

2. Define your LangGraph agent

Write your graph in src/agent/graph.py:

from langgraph.graph import StateGraph
from langgraph.types import Command, interrupt

# Define state, nodes, edges
builder = StateGraph(State)
builder.add_node("agent", call_model)
builder.add_node("tools", tool_node)
# ... wire up edges
graph = builder.compile()

3. Register in aegra.json

{
  "graphs": {
    "agent": "./src/agent/graph.py:graph"
  }
}

Aegra automatically creates a default assistant for each graph.

4. Create threads and run conversations

from langgraph_sdk import get_client

client = get_client(url="http://localhost:2026")
thread = await client.threads.create()

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

5. Add authentication (if needed)

Create auth.py:

from langgraph_sdk import Auth

auth = Auth()

@auth.authenticate
async def authenticate(headers: dict) -> dict:
    token = headers.get("Authorization", "").replace("Bearer ", "")
    if not token:
        raise Exception("Missing token")
    # Verify token (JWT, OAuth, etc.)
    return {"identity": "user123", "display_name": "Alice"}

Update aegra.json:

{
  "auth": {
    "path": "./auth.py:auth"
  }
}

6. Deploy

Docker (self-hosted):

aegra up

PaaS (Railway, Render, Fly.io):

  • Create PostgreSQL addon
  • Create Redis addon (optional but recommended)
  • Set DATABASE_URL, REDIS_URL, REDIS_BROKER_ENABLED=true
  • Set start command: aegra serve --host 0.0.0.0 --port $PORT

Kubernetes:

  • Use aegra serve as container command
  • Provide PostgreSQL and Redis as managed services or StatefulSets
  • Use readiness probe: GET /ready
  • Use liveness probe: GET /live

Common gotchas

  • Graph not loading — Check that the import path in aegra.json is correct and the variable is actually exported. Relative paths are resolved from the config file's directory.

  • Auth not working — Verify the auth handler is registered with @auth.authenticate and raises exceptions to reject requests (don't return a guest user to mean "no").

  • Migrations hang on startup (Kubernetes) — Multiple pods race for Alembic's advisory lock. Set RUN_MIGRATIONS_ON_STARTUP=false and run aegra db upgrade once per release from a Helm pre-upgrade Job.

  • Checkpoint durability confusion — exit mode only writes one checkpoint per run, so you can't inspect or fork from steps inside the run. Use sync or async if you need mid-run recovery or time travel.

  • Thread TTL not working — TTL applies only to threads created after it's enabled. Pre-existing threads are not backfilled. Threads with pending/running runs are skipped and swept later.

  • Custom routes not authenticated — By default, custom FastAPI routes don't require auth. Set enable_custom_route_auth: true in aegra.json to enforce auth on all custom routes.

  • Streaming reconnection lost — Track the last event ID you received and reconnect with the Last-Event-ID header. Events are retained for 10 minutes after the run completes.

  • Factory graph called multiple times — Factory graphs are called once at startup (for schema extraction) and once per request (for execution). Use runtime.execution_runtime to detect which context you're in.

  • Metadata merging on update — When updating an assistant, metadata merges into existing metadata (doesn't replace). Use config or context if you need to clear fields.

  • User isolation missing — When auth is enabled, threads are scoped to the authenticated user. Without auth, all users share the anonymous identity and see each other's threads.

Verification checklist

Before deploying or submitting work:

  • aegra.json is valid JSON and all graph import paths exist
  • All required environment variables are set (.env file or platform config)
  • Database connection works: aegra dev or aegra serve starts without connection errors
  • Migrations applied: check logs for "alembic upgrade head" or run aegra db current
  • Graph loads: visit http://localhost:2026/docs and check /assistants endpoint
  • Authentication handler (if configured) raises exceptions to reject invalid tokens
  • Thread creation works: POST /threads returns a thread with thread_id
  • Run creation works: POST /threads/{id}/runs returns a run with run_id
  • Streaming works: GET /threads/{id}/runs/{id}/stream returns SSE events
  • State persists: create a thread, run a conversation, retrieve state with GET /threads/{id}/state
  • Custom routes (if any) are registered in aegra.json and accessible
  • Health checks pass: GET /health, GET /ready, GET /live all return 200
  • For production: Redis is running if REDIS_BROKER_ENABLED=true
  • For Kubernetes: RUN_MIGRATIONS_ON_STARTUP=false and migrations run out-of-band

Resources

Full documentation navigation: https://docs.aegra.dev/llms.txt

Critical pages:


For additional documentation and navigation, see: https://docs.aegra.dev/llms.txt

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/docs.aegra.dev/aegra">View aegra on skillZs</a>