getzep / zep

Zep | The Memory Foundation For Your AI Stack
https://help.getzep.com/ce
Apache License 2.0
2.68k stars 383 forks source link

[FEAT] Template to install Zep on Easypanel #358

Closed rodrigocpaiva closed 1 month ago

rodrigocpaiva commented 1 month ago

Hi, please, can you help me to install Zep on Easypanel 1.51? My Easypanel runs in a Hostinger VPC on Ubuntu. More details below:

Zep offers a docker compose for self-hosting installation (includes postgres and zet-nlp-server), but Easypanel doesn't support compose.

I tried to convert the docker compose to a Easypanel Template (code below), but after running it shows the error: level=fatal msg="store.type must be set" even using the following env variables:

ZEP_STORE_TYPE=postgres
ZEP_STORE_POSTGRES_DSN=postgres://postgres:postgres@zep-db:5432/postgres?sslmode=disable
ZEP_NLP_SERVER_URL=http://0.0.0.0:5557
ZEP_EXTRACTORS_DOCUMENTS_EMBEDDINGS_SERVICE=openai
ZEP_EXTRACTORS_DOCUMENTS_EMBEDDINGS_DIMENSIONS=1536
ZEP_EXTRACTORS_MESSAGES_EMBEDDINGS_SERVICE=openai
ZEP_EXTRACTORS_MESSAGES_EMBEDDINGS_DIMENSIONS=1536
ZEP_EXTRACTORS_MESSAGES_SUMMARIZER_EMBEDDINGS_SERVICE=openai
ZEP_EXTRACTORS_MESSAGES_SUMMARIZER_EMBEDDINGS_DIMENSIONS=1536
ZEP_OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
ZEP_SERVER-HOST=0.0.0.0
ZEP_SERVER_PORT=8000
ZEP_SERVER_WEB_ENABLED=true
ZEP_LOG-LEVEL=info
ZEP_LLM_SERVICE=openai
ZEP_LLM_MODEL=gpt-3.5-turbo

My template is below.

{
  "services": [
    {
      "type": "app",
      "data": {
        "serviceName": "zep-db",
        "source": {
          "type": "image",
          "image": "ghcr.io/getzep/postgres:latest" // Replace with your pre-built image if using a custom Dockerfile
        },
        "env": "POSTGRES_USER=postgres\nPOSTGRES_PASSWORD=postgres",
        "mounts": [
          {
            "type": "volume",
            "name": "zep-db-data",
            "mountPath": "/var/lib/postgresql/data"
          }
        ],
        "healthcheck": {
          "test": ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"],
          "interval": "5s",
          "timeout": "5s",
          "retries": 5
        }
      }
    },
    {
      "type": "app",
      "data": {
        "serviceName": "zep-nlp",
        "source": {
          "type": "image",
          "image": "ghcr.io/getzep/zep-nlp-server:latest"
        },
        "healthcheck": {
          "test": "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5557' || exit 1",
          "interval": "10s",
          "timeout": "5s",
          "retries": 5,
          "startPeriod": "45s"
        }
      }
    },
    {
      "type": "app",
      "data": {
        "serviceName": "zep",
        "source": {
          "type": "image",
          "image": "ghcr.io/getzep/zep:latest" // Replace with your pre-built image if using a custom Dockerfile
        },
        "env": "ZEP_STORE_POSTGRES_DSN=postgres://postgres:postgres@zep-db:5432/postgres?sslmode=disable\nZEP_NLP_SERVER_URL=http://zep-nlp:5557\nZEP_EXTRACTORS_DOCUMENTS_EMBEDDINGS_SERVICE=openai\nZEP_EXTRACTORS_DOCUMENTS_EMBEDDINGS_DIMENSIONS=1536\nZEP_EXTRACTORS_MESSAGES_EMBEDDINGS_SERVICE=openai\nZEP_EXTRACTORS_MESSAGES_EMBEDDINGS_DIMENSIONS=1536\nZEP_EXTRACTORS_MESSAGES_SUMMARIZER_EMBEDDINGS_SERVICE=openai\nZEP_EXTRACTORS_MESSAGES_SUMMARIZER_EMBEDDINGS_DIMENSIONS=1536\nZEP_OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>\nZEP_CONFIG={\"store\":{\"type\":\"postgres\"}}", // Add other config.yaml values within ZEP_CONFIG
        "domains": [
          {
            "host": "$(EASYPANEL_DOMAIN)",
            "port": 8000
          }
        ],
        "dependencies": [
          "zep-db",
          "zep-nlp"
        ],
        "healthcheck": {
          "test": "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8000' || exit 1",
          "interval": "5s",
          "timeout": "10s",
          "retries": 3,
          "startPeriod": "40s"
        }
      }
    }
  ]
}
rodrigocpaiva commented 1 month ago

I've found the solution. To resolve this, you need to add a bind mount that points the host path to the full path of the config.yaml file on your server (e.g. /etc/easypanel/projects/eduzen/zep/volumes/zep-data/config.yaml). On the Mount Path, set /app/config.yaml. This should properly link the configuration file for the getzep/zep installation on Easypanel.

Captura de Tela 2024-09-19 às 14 18 58