Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 939 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 939 Bytes

Cortex

AI service for theblueprintcode. Tenant-aware knowledge hub (RAG), agents (LangGraph) and MCP tools, sitting beside engine. Full plan: ../docs/ai-module-plan.md.

Run

cp .env.example .env          # set JWT_ACCESS_SECRET to the same value as engine/.env
createdb cortex               # on the local Postgres (:5432); needs the pgvector extension available (Postgres.app ships it)
uv sync
uv run uvicorn app.main:app --reload --port 5202
uv run pytest
  • GET /health checks the AI database.
  • GET /v1/whoami (Bearer token from the engine's /auth/login) shows the AI schema Cortex derived from the token.

How tenancy works here

Cortex trusts only the engine-signed JWT. Tenant tokens map to schema ai_<accountId>, root (platform) tokens map to public. The schema is never read from the request body or headers. All DB access goes through app/db.py:tenant_connection.