Skip to main content

Using the CLI

The CLI is the recommended way to create and manage Aegra projects.
Then initialize a new project:
The CLI prompts you for a location, a template (simple-chatbot or react-agent), and a project name. It generates the project structure, aegra.json, Dockerfile, docker-compose.yml, and .env.example.
Install aegra-cli directly — not the aegra meta-package on PyPI. The aegra package is a convenience wrapper that does not support version pinning.

From source

Clone the repository and run directly:
Install dependencies and start the development server:
Or start with Docker Compose:

Requirements

Python

Aegra requires Python 3.12+ for both the API server and the CLI.

LangGraph

aegra-api requires langgraph>=1.2.16, and projects created with aegra init start on the same minimum. Only a minimum is set, so a fresh install (pip install aegra-cli, or a project without a lock file) gets the newest LangGraph release. A project with a uv.lock keeps the versions in that lock file until you run uv lock --upgrade. Each Aegra release is tested against the exact versions in the repository’s uv.lock at that release tag. A nightly CI job also runs the test suite against the newest releases of every dependency, so a breaking LangGraph release is caught soon after it ships. If a newer release causes errors:
  1. Find your Aegra version with pip show aegra-api.
  2. Open uv.lock at that release tag, for example https://github.com/aegra/aegra/blob/v0.11.0/uv.lock.
  3. Pin langgraph, langgraph-checkpoint and langchain-core to the versions in that file.
  4. Open an issue with the LangGraph version that fails.

PostgreSQL

Aegra uses PostgreSQL with the pgvector extension for persistence and vector search. The recommended image is pgvector/pgvector:pg18. When you use aegra dev or aegra up, PostgreSQL is started automatically via Docker. For aegra serve, you provide your own database via DATABASE_URL or POSTGRES_* environment variables.

Docker

Docker is required for local development (aegra dev starts a PostgreSQL container). For production, you can either run everything in Docker (aegra up) or provide an external database and run with aegra serve.

Windows

aegra dev, aegra up, and aegra serve work on Windows. The CLI passes uvicorn a SelectorEventLoop factory on Windows, since psycopg cannot connect on the ProactorEventLoop that uvicorn otherwise defaults to without --reload. For production deployments we still recommend Docker or a Linux server.

Project structure

After aegra init, your project looks like this:

Verify the installation

Start the server and check the health endpoint:
In another terminal:
You should see:
Visit http://localhost:2026/docs for the interactive API documentation.