How radsrei/pac-resposta-de-nimb works
Nimb is a Tormenta20 book-grounded question-answering application with a React interface and FastAPI backend. Users authenticate, choose or configure an LLM, ask questions, and receive answers grounded in authorized book passages; successful exchanges are saved as chat sessions. Books are prepared separately by the vector builder, then cataloged for retrieval. The README also identifies book upload/validation, treasure rolls, and chaos behavior as product capabilities. Some backend and frontend modules were not sampled, so those branches are shown only where the index or README supports them.
Main entry points: cli.py Index builder · query_controller.py Question handling · main.py FastAPI app · App.tsx Auth gate
Components 25
User interface
- Auth gate
frontend/V2 - front Studio/src/App.tsx - Nimb terminal
frontend/V2 - front Studio/src/Terminal.tsx - Frontend API clients
frontend/V2 - front Studio/src/services
API and identity
- FastAPI app
backend/app/main.py - Authentication
backend/app/controllers/auth_controller.py - RAG routes
backend/app/routers/rag.py - Application database
backend/app/db/database.py
Book answers
- Question handling
backend/app/controllers/query_controller.py - Book retrieval
backend/app/services/retrieval.py - Book catalog
backend/app/services/book_catalog.py - Book indexes
backend/app/services/book_catalog.py - Embedding service
backend/app/services/embeddings.py
Book preparation
- Book upload and checks
backend/app/controllers/book_controller.py - Index builder
backend/vector_builder/cli.py - PDF extraction
backend/vector_builder/extract.py - Passage chunking
backend/vector_builder/chunking.py - Table parsing
backend/vector_builder/tables.py
LLM and extras
- LLM connections
backend/app/controllers/llm_controller.py - LLM settings store
backend/app/repositories/llm_repository.py - LLM client
backend/app/services/llm_client.py - Chat history
backend/app/repositories/session_repository.py - Treasure rolls
backend/app/controllers/treasure_controller.py
Other components
- Player
- Google sign-in
- LLM provider
Connections 25
- Player → Auth gate: uses
- Auth gate → Nimb terminal: opens when signed in
frontend/V2 - front Studio/src/App.tsx - Auth gate → Frontend API clients: checks session
frontend/V2 - front Studio/src/App.tsx - Frontend API clients → FastAPI app: calls API
- Google sign-in → Authentication: authenticates
- FastAPI app → RAG routes: registers
backend/app/main.py - FastAPI app → Authentication: seeds LLM settings
backend/app/main.py - RAG routes → Question handling: routes questions
backend/app/routers/rag.py - Question handling → Book retrieval: searches passages
backend/app/controllers/query_controller.py - Question handling → LLM settings store: resolves connection
backend/app/controllers/query_controller.py - Question handling → LLM client: requests answer
backend/app/controllers/query_controller.py - Question handling → Chat history: saves exchange
backend/app/controllers/query_controller.py - Book retrieval → Book catalog: locates book data
backend/app/services/retrieval.py - Book catalog → Book indexes: reads index files
backend/app/services/book_catalog.py - Book retrieval → Embedding service: embeds query
backend/app/services/retrieval.py - Book upload and checks → RAG routes: serves book routes
backend/app/routers/rag.py - Index builder → PDF extraction: extracts content
backend/vector_builder/cli.py - Index builder → Passage chunking: chunks content
backend/vector_builder/cli.py - Index builder → Table parsing: builds table data
backend/vector_builder/cli.py - Index builder → Book catalog: registers books
backend/vector_builder/cli.py - Index builder → Book indexes: writes indexes
backend/vector_builder/cli.py - LLM connections → LLM settings store: stores connections
backend/app/controllers/llm_controller.py - LLM client → LLM provider: sends prompts
backend/app/services/llm_client.py - FastAPI app → Application database: initializes database
backend/app/main.py - Treasure rolls → Application database: persists rolls