Skip to main content

Installation

This guide walks you through installing the Aegis Memory SDK and starting the memory server locally.

Prerequisites

Before you begin, ensure you have:
  • Python 3.9+ — Check with python --version
  • Docker & Docker Compose — The memory server runs in containers
  • OpenAI API key — Used for generating embeddings (get one here)

Step 1: Install the SDK

pip install aegis-memory
With framework integrations:
# For CrewAI
pip install "aegis-memory[crewai]"

# For LangChain
pip install "aegis-memory[langchain]"

# All integrations
pip install "aegis-memory[all]"

Step 2: Start the Memory Server

Step 3: Configure Environment

Create a .env file in your project directory:
.env
# Required for embeddings
OPENAI_API_KEY=sk-your-openai-key-here

# For local development, any string works as the API key
AEGIS_API_KEY=dev-key

# Optional: defaults to localhost
AEGIS_BASE_URL=http://localhost:8000
Or export them directly in your terminal:
export OPENAI_API_KEY="sk-..."
export AEGIS_API_KEY="dev-key"

Step 4: Verify Installation

from aegis_memory import AegisClient

client = AegisClient(
    api_key="dev-key",
    base_url="http://localhost:8000"
)

# Add a test memory
result = client.add("Test memory - Aegis is working!")
print(f"Memory stored: {result.id}")

# Query it back
memories = client.query("test memory")
print(f"Retrieved: {memories[0].content}")
You should see your test memory returned! If so, Aegis is ready to use.

Next Steps


Troubleshooting

Check if ports 8000 or 5432 are already in use:
lsof -i :8000
lsof -i :5432
Kill conflicting processes or change ports in docker-compose.yml.
Wait for PostgreSQL to be ready:
docker-compose logs postgres
Look for “database system is ready to accept connections”.
Ensure your API key is set and has credits:
echo $OPENAI_API_KEY
Test directly:
curl https://api.openai.com/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"

Reference: What’s Running

After starting the server, these services are available:
ServicePortPurpose
Aegis API8000REST API for memory operations
PostgreSQL5432Vector storage with pgvector
Redis (optional)6379Caching and rate limiting