- docker-compose: swap postgres image to pgvector/pgvector:pg16
- postgres/init.sql: CREATE EXTENSION vector; image_embedding table
- plugins/embeddings.py: embed_images + search_images_semantic
(sentence-transformers all-MiniLM-L6-v2, lazy-loaded, pgvector <=> cosine)
- plugins/images.py: register_image kicks off background embed worker
- seed.py: seed_embeddings writes 4 embeddings for the mock images
- README: semantic image search section + T3 note
- 11 tests across 4 files, all green:
test_embeddings_plugin.py (4): schema, ordering, idempotency, stub
test_embeddings_real_model.py (3): real MiniLM, acceptance queries
test_register_image_hook.py (2): manifest row, end-to-end hook
test_seed_embeddings.py (2): writes 4, idempotent
- Includes T3 consistency plugin skeleton (4 stub tools)
100 lines
3.2 KiB
YAML
100 lines
3.2 KiB
YAML
name: lore-engine-poc
|
|
|
|
# Lore Engine POC: Neo4j + Postgres + MinIO + Python plugin gateway
|
|
# Validates the v1.1 plugin architecture and image recall.
|
|
|
|
services:
|
|
|
|
# ─── Neo4j — world graph ────────────────────────────────────────────────────
|
|
neo4j:
|
|
image: neo4j:5.26-community
|
|
container_name: lore-neo4j
|
|
environment:
|
|
NEO4J_AUTH: neo4j/lore-dev-password
|
|
NEO4J_PLUGINS: '["apoc"]'
|
|
NEO4J_apoc_export_file_enabled: "true"
|
|
NEO4J_apoc_import_file_enabled: "true"
|
|
NEO4J_server_memory_heap_initial__size: 512m
|
|
NEO4J_server_memory_heap_max__size: 1g
|
|
ports:
|
|
- "7474:7474" # browser
|
|
- "7687:7687" # bolt
|
|
volumes:
|
|
- neo4j-data:/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:7474 || exit 1"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
# ─── Postgres — operational data + embeddings ──────────────────────────────
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
container_name: lore-postgres
|
|
environment:
|
|
POSTGRES_USER: lore
|
|
POSTGRES_PASSWORD: lore-dev-password
|
|
POSTGRES_DB: lore
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U lore -d lore"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
# ─── MinIO — blob storage for images ────────────────────────────────────────
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: lore-minio
|
|
environment:
|
|
MINIO_ROOT_USER: lorelore
|
|
MINIO_ROOT_PASSWORD: lore-dev-password
|
|
command: server /data --console-address ":9001"
|
|
ports:
|
|
- "9000:9000" # S3 API
|
|
- "9001:9001" # console
|
|
volumes:
|
|
- minio-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
# ─── Lore Gateway — Python MCP server, plugin-driven ───────────────────────
|
|
gateway:
|
|
build:
|
|
context: ./gateway
|
|
container_name: lore-gateway
|
|
depends_on:
|
|
neo4j: { condition: service_healthy }
|
|
postgres: { condition: service_healthy }
|
|
minio: { condition: service_healthy }
|
|
environment:
|
|
NEO4J_URL: bolt://neo4j:7687
|
|
NEO4J_USER: neo4j
|
|
NEO4J_PASSWORD: lore-dev-password
|
|
POSTGRES_URL: postgresql://lore:lore-dev-password@postgres:5432/lore
|
|
MINIO_URL: http://minio:9000
|
|
MINIO_ACCESS_KEY: lorelore
|
|
MINIO_SECRET_KEY: lore-dev-password
|
|
MINIO_BUCKET: lore-images
|
|
MINIO_PUBLIC_URL: http://localhost:9000
|
|
PLUGINS_DIR: /app/plugins
|
|
INIT_CYPHER: /app/neo4j/init.cypher
|
|
ports:
|
|
- "8765:8765" # MCP JSON-RPC
|
|
volumes:
|
|
- ./plugins:/app/plugins:ro
|
|
- ./neo4j:/app/neo4j:ro
|
|
- ./mock-data:/app/mock-data:ro
|
|
|
|
volumes:
|
|
neo4j-data:
|
|
postgres-data:
|
|
minio-data:
|