MemGPT

Create LLM agents with long-term memory and custom tools 📚🦙.

Directory Structure

    • .env
    • docker-compose.yml

docker-compose.yml

version: "3.9"
 
services:
  memgpt_db:
    image: ankane/pgvector:v0.5.1
    networks:
      default:
        aliases:
          - pgvector_db
          - memgpt-db
    environment:
      - POSTGRES_USER=${MEMGPT_PG_USER}
      - POSTGRES_PASSWORD=${MEMGPT_PG_PASSWORD}
      - POSTGRES_DB=${MEMGPT_PG_DB}
    volumes:
      - ./.persist/pgdata:/var/lib/postgresql/data
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    ports:
      - "5432:5432"
  memgpt_server:
    image: memgpt/memgpt-server:latest
    hostname: memgpt-server
    depends_on:
      - memgpt_db
    ports:
      - "8083:8083"
      - "8283:8283"
    env_file:
      - .env
    environment:
      - POSTGRES_URI=postgresql://${MEMGPT_PG_USER}:${MEMGPT_PG_PASSWORD}@pgvector_db:5432/${MEMGPT_PG_DB} # TODO: deprecate
      - MEMGPT_SERVER_PASS=${MEMGPT_SERVER_PASS} # memgpt server password
      - MEMGPT_PG_DB=${MEMGPT_PG_DB}
      - MEMGPT_PG_USER=${MEMGPT_PG_USER}
      - MEMGPT_PG_PASSWORD=${MEMGPT_PG_PASSWORD}
      - MEMGPT_PG_HOST=pgvector_db
      - MEMGPT_PG_PORT=5432
      - OPENAI_API_KEY=${OPENAI_API_KEY}
    volumes:
      - ./configs/server_config.yaml:/root/.memgpt/config # config file
      - ~/.memgpt/credentials:/root/.memgpt/credentials # credentials file
  memgpt_nginx:
    hostname: memgpt-nginx
    image: nginx:stable-alpine3.17-slim
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
    ports:
      - "80:80"
    restart: unless-stopped

.env

MEMGPT_SERVER_PASS=password
MEMGPT_PG_DB=memgpt
MEMGPT_PG_USER=memgpt
MEMGPT_PG_PASSWORD=memgpt
MEMGPT_PG_URL=memgpt
MEMGPT_PG_HOST=memgpt_db
OPENAI_API_KEY=sk-TheresAlwaysMoneyInTheBananaStand

Resources

Website: https://memgpt.ai/

Docs: https://memgpt.readme.io/

GitHub: https://github.com/cpacker/MemGPT

Docker Hub: https://hub.docker.com/r/memgpt/memgpt-server

Configuration: https://memgpt.readme.io/docs/running-a-memgpt-server