|
2 | 2 |
|
3 | 3 | ## Context Summary |
4 | 4 | - Project: RethinkAI Dorchester community assistant combining SQL, RAG, and hybrid LLM routing. |
5 | | -- Key code: `main_chat/main_chat.py` (routing + cache), `api/api.py` (Flask API v2.0), static frontends `public/` (prod-style) and `test_frontend/` (tester UI). |
6 | | -- Data: MySQL tables (311/911/events) and Chroma-style vector DB in `main_chat/vectordb_new`. Ingestion lives in `main_chat/data_ingestion/`. |
7 | | -- Auth: API key header `RethinkAI-API-Key` is required; default sample key `banana`. |
| 5 | +- Key code: `main_chat/main_chat.py` (routing + cache), `api/api.py` (Flask API v2.0), static frontends `public/` (prod-style) |
| 6 | +- Data: MySQL tables (311/911/events) and Chroma-style vector DB in `main_chat/vectordb`. Ingestion lives in `main_chat/data_ingestion/`. |
| 7 | +- Auth: API key header `RethinkAI-API-Key` is required |
8 | 8 |
|
9 | 9 | ## Architecture |
10 | 10 | - **Client**: Vanilla HTML/CSS/JS frontends (`public`) call REST API at `http://127.0.0.1:8888` with API key; show chat, events, API tester. |
|
21 | 21 | - Core logic: `main_chat/chat_route.py` (env bootstrap, vectordb path fix, LLM client setup, routing, cache mgmt, history reuse). |
22 | 22 | - Data ingestion: `main_chat/data_ingestion/` (Google Drive/email sync, DB setup, vector rebuild) — not part of runtime API but seeds data. |
23 | 23 | - Frontends: `public/` (production-like static UI); configurable `API_BASE_URL` and `API_KEY` in JS. |
24 | | -- Prompts/config: `api/prompts/`, `.env` at repo root (copy from `example_env.txt`). |
25 | 24 |
|
26 | 25 | ## Dependencies (runtime highlights) |
27 | 26 | - Python 3.11+, Flask 3.x, mysql-connector-python, google-genai, dotenv, pandas/numpy, plotly/dash (legacy), httpx/requests. |
28 | 27 | - MySQL 8.x for structured data. |
29 | | -- Vector store: Chroma-style files under `main_chat/vectordb_new`. |
| 28 | +- Vector store: Chroma-style files under `main_chat/vectordb`. |
30 | 29 | - Frontend: vanilla JS/CSS, served via `python -m http.server` (no build). |
31 | 30 |
|
32 | 31 | ## Data Flow |
|
69 | 68 | - Document schema for 311/911 tables in `dataset-documentation/` and link from API docs. |
70 | 69 |
|
71 | 70 | ## Assorted Notes |
72 | | -- Frontend default API key `'banana'` must match `.env` `RETHINKAI_API_KEYS`. |
73 | | -- `api/api.py` and `/data/query` legacy endpoints are deprecated; prefer `api.py`. |
74 | 71 | - LLM defaults to `gemini-2.5-flash-lite`; override via env `GEMINI_MODEL`. |
75 | 72 |
|
0 commit comments