Self-Hosting

Run AgentRecall on your own infrastructure with full control over data and models.

BYOK Mode (Bring Your Own Key)

Self-hosting gives you complete control. Your data never leaves your servers, and you can use your own Neo4j instance and AI model.

Docker Setup

# docker-compose.yml
version: "3.8"
services:
  agentrecall:
    image: agentrecall/agentrecall:latest
    ports:
      - "8700:8700"
    environment:
      - NEO4J_URI=bolt://neo4j:7687
      - NEO4J_USER=neo4j
      - NEO4J_PASSWORD=***
      - MODEL_PATH=Qwen/Qwen2.5-7B
      - MODE=local
    depends_on:
      - neo4j

  neo4j:
    image: neo4j:5
    ports:
      - "7474:7474"
      - "7687:7687"
    environment:
      - NEO4J_AUTH=***
    volumes:
      - neo4j_data:/data

volumes:
  neo4j_data:
docker compose up -d

Running with Your Own Neo4j

# Connect to an existing Neo4j instance
from agentrecall_sdk import AgentRecall

memory = AgentRecall(
    mode="local",
    neo4j_uri="bolt://your-neo4j-host:7687",
    neo4j_user="neo4j",
    neo4j_password="your_password"
)

Running with Your Own Model

By default, local mode uses a bundled Qwen2.5-7B. You can swap in any compatible model:

# Using a different model path
memory = AgentRecall(
    mode="local",
    model_path="/path/to/your/model",
    neo4j_uri="bolt://localhost:7687",
    neo4j_user="neo4j",
    neo4j_password="password"
)

Environment Variables

VariableDefaultDescription
MODEcloudcloud or local
NEO4J_URIbolt://localhost:7687Neo4j connection URI
NEO4J_USERneo4jNeo4j username
NEO4J_PASSWORDNeo4j password
MODEL_PATHQwen/Qwen2.5-7BHuggingFace model or local path
API_PORT8700API server port
API_KEYAPI key for authentication
LOG_LEVELinfoLogging verbosity

Verification

# Health check
curl http://localhost:8700/health

# Expected response
{
  "status": "healthy",
  "mode": "local",
  "neo4j": "connected",
  "model": "Qwen/Qwen2.5-7B"
}