feat: scaffold Brain of Reese — FastAPI RAG chat over Postgres 17 + pgvector
Foundation (phase 01, verified): - FastAPI app: /api/health, /api/suggestions, /api/chat (placeholder), static frontend served locally (no CDN) - Postgres 17 + pgvector via db/Containerfile + compose.yaml (podman compose up -d db), Alembic initial migration (documents, chunks with vector(768), query_log) - LLM client targeting https://aipi.reeseapps.com/v1 (turbo/embed); scripts/llm_probe.py verified models + 768-dim embeddings live - Conditional debugpy: imported only when DEBUGPY=1 (attach on demand, :5678); logging config for clean single-line logs - Frontend shell: mobile-first chat + Sources pages, tokens, a11y baselines - Tests: 24 unit+integration (99% coverage on app/), ruff + pyright clean, Playwright smoke E2E (3 tests) against a deterministic mock LLM - Planning: .agent/PLAN.md (architecture + LOCKED decisions), AGENTS.md, 6 user stories, 7 phase files (one story / one phase / one Playwright suite each)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Brain of Reese — environment configuration
|
||||
# Copy to `.env` and adjust: cp .env.example .env
|
||||
# (`.env` is gitignored; never commit secrets.)
|
||||
|
||||
# --- App ---
|
||||
BOR_ENVIRONMENT=development
|
||||
# BOR_LOG_LEVEL=INFO
|
||||
# BOR_STATIC_DIR=frontend # dev default; container sets /app/static
|
||||
|
||||
# --- Database (matches `podman compose` db service) ---
|
||||
BOR_DATABASE_URL=postgresql+psycopg://reese:reese@localhost:5432/brain_of_reese
|
||||
|
||||
# --- LLM (self-hosted, OpenAI-compatible "aipi") ---
|
||||
BOR_LLM_BASE_URL=https://aipi.reeseapps.com/v1
|
||||
BOR_LLM_API_KEY= # falls back to $AIPI_KEY, then "not-needed"
|
||||
BOR_LLM_CHAT_MODEL=turbo
|
||||
BOR_LLM_EMBED_MODEL=embed
|
||||
BOR_EMBEDDING_DIM=768 # verified 2026-08 via scripts/llm_probe.py
|
||||
|
||||
# --- RAG tuning ---
|
||||
BOR_TOP_K_CHUNKS=4
|
||||
BOR_TOP_N_DOCS=2
|
||||
BOR_RELEVANCE_THRESHOLD=0.30 # max cosine similarity required to answer (else honest deflection)
|
||||
BOR_MAX_CONTEXT_CHARS=24000 # cap on total document text sent to the LLM
|
||||
BOR_CHUNK_TARGET_CHARS=2000
|
||||
BOR_CHUNK_OVERLAP_CHARS=200
|
||||
BOR_EMBED_BATCH_SIZE=16
|
||||
|
||||
# --- Debugging (0/1 — 1 enables attach-on-demand debugpy on port 5678) ---
|
||||
DEBUGPY=0
|
||||
# DEBUGPY_PORT=5678
|
||||
Reference in New Issue
Block a user