Skip to content

Project Layout

PantheraNestah edited this page Nov 5, 2026 · 2 revisions

Project Layout

.
├── app/
│   ├── main.py                    FastAPI app; lifespan: create tables, preload models
│   ├── api/routes.py              /query, /learn/structured, /learn/text
│   ├── dependencies/pipeline.py   provides the RAGPipeline instance
│   ├── middleware/timer.py        adds the X-Process-Time header
│   ├── schemas/
│   │   ├── query.py               request models
│   │   └── response.py            response models, lesson enums
│   ├── services/
│   │   ├── pipeline.py            orchestration; runs blocking work in threads
│   │   ├── retriever.py           hybrid retrieval
│   │   ├── generator.py           prompts, JSON handling, fallbacks
│   │   ├── llm.py                 tiered multi-provider LLM layer
│   │   ├── warmup.py              startup model preload
│   │   ├── interaction_logger.py  background verification and DB writes
│   │   └── embedder.py            unused
│   ├── core/
│   │   ├── verifier.py            NLI grounding verification
│   │   ├── instrumentation.py     citation counting
│   │   ├── config.py              APP_NAME, APP_VERSION, DEBUG
│   │   ├── exceptions.py          unused helper
│   │   └── logger.py              application logger
│   ├── database/
│   │   ├── models.py              SQLAlchemy tables
│   │   └── db.py                  async engine, WAL and timeout settings
│   ├── utils/preprocess.py        trim and lower-case the query
│   └── chroma_storage/            vector store (gitignored, built locally)
├── alembic/                       migration scripts (see Data and Logging)
├── data/
│   ├── raw/                       six source PDFs
│   ├── knowledge_base/            extracted chunks (JSON)
│   └── scripts/                   ingest, embed, build the vector store
├── evaluation/                    test set, harness scripts, results/
├── tests/                         pytest suite (47 tests)
├── docs/
│   ├── rag_evaluation_report.md   historical evaluation report
│   └── images/                    cover photo and original design sketch
├── .env.example                   all environment variables, no values
├── requirements.txt
├── run.sh                         dev server (binds 0.0.0.0, --reload)
└── VERSION

Gitignored and local only: .env, .venv/, app/chroma_storage/, nutripepper.db and its -wal/-shm/-journal files, logs/.

docs/rag_evaluation_report.md is a historical evaluation write-up; its figures predate the current models (Evaluation). See Architecture for how the pieces fit.

Clone this wiki locally