/ Introduction
GitHub

Introduction

Getting Started · 5 min read

CrewLayer is an open-source backend for AI agents. It provides persistent memory, shared context, a full action history, and multi-tenant isolation — all through a simple REST API and official SDKs.

The goal is that any developer can wire their agent into CrewLayer in minutes and never worry about state management, memory, or logs again. It works with any agent framework: LangChain, AutoGen, LlamaIndex, Vercel AI SDK, CrewAI, or plain Python.

CrewLayer is self-hosted, MIT-licensed, and ships as a single docker compose up -d command. No SaaS pricing. No data leaving your infrastructure. You own everything.

Architecture

CrewLayer is a FastAPI application backed by PostgreSQL (with pgvector) for long-term storage and Redis for short-term memory and pub/sub:

architecture
┌─────────────────────────────────────────────────────────────┐
│                        Your Agent(s)                        │
│                 (LangChain / AutoGen / SDK)                  │
└────────────────────────┬────────────────────────────────────┘
                         │  REST API / MCP tools
                         ▼
┌─────────────────────────────────────────────────────────────┐
│                   CrewLayer API (FastAPI)                    │
│                                                             │
│  /v1/agents   /v1/memory   /v1/actions   /v1/context        │
│  /v1/sessions /v1/episodes /v1/evaluations /v1/webhooks      │
└──────────┬──────────────────────────┬───────────────────────┘
           │                          │
    ┌──────▼──────┐           ┌───────▼───────┐
    │ PostgreSQL  │           │     Redis     │
    │ + pgvector  │           │               │
    │             │           │ Short-term    │
    │ Long-term   │           │ memory        │
    │ memory      │           │ Pub/sub       │
    │ Actions     │           │ Status cache  │
    │ Agents      │           └───────────────┘
    │ Episodes    │
    └─────────────┘

What it gives you

Tech stack

LayerTechnology
APIFastAPI (Python 3.12+)
Primary DBPostgreSQL 16 + pgvector
Cache / short-term memoryRedis 7
Semantic embeddingsAnthropic API or local sentence-transformers
Memory extractionclaude-opus-4-8
AuthAPI Keys (bcrypt hash) + JWT for dashboard
DeployDocker Compose (one command)
Testingpytest + httpx (441 tests)

Next steps

Ready to get started? Head to Quick Start to have your first agent storing memories in under 5 minutes.

If you want to understand the data model first, read Core Concepts. For a full endpoint reference, see the API Reference.