> ## Documentation Index
> Fetch the complete documentation index at: https://docs.negentro.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Hosted AI Companion with Ollama & pgvector

> Run an air-gapped cognitive memory engine entirely on local hardware.

## Docker Compose Setup

```bash docker-compose.yml theme={null}
version: '3.8'
services:
  piyapi-engine:
    image: piyapi/cognitive-engine:latest
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=postgresql://piyapi:secret@postgres:5432/piyapi_db
      - REDIS_URL=redis://redis:6379
      - EMBEDDING_PROVIDER=ollama
      - OLLAMA_HOST=http://host.docker.internal:11434
    depends_on:
      - postgres
      - redis

  postgres:
    image: pgvector/pgvector:pg16
    environment:
      - POSTGRES_DB=piyapi_db
      - POSTGRES_USER=piyapi
      - POSTGRES_PASSWORD=secret
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.