fix: brain service — pgvector extension init, meili key length

Brain service fully operational:
- All 6 containers running
- API responds on /api/health
- Worker processes items (fetch, screenshot, classify, index)
- Tested: link creation, background processing, asset archival

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-01 11:53:25 -05:00
parent 8275f3a71b
commit c9e776df59
3 changed files with 1748 additions and 4 deletions

View File

@@ -27,11 +27,13 @@ app.include_router(router)
@app.on_event("startup")
async def startup():
from sqlalchemy import text as sa_text
from app.database import engine, Base
from app.models.item import Item, ItemAsset, AppLink # noqa: import to register models
# Create tables if they don't exist
# Enable pgvector extension before creating tables
async with engine.begin() as conn:
await conn.execute(sa_text("CREATE EXTENSION IF NOT EXISTS vector"))
await conn.run_sync(Base.metadata.create_all)
# Ensure Meilisearch index exists