Spaces:
Sleeping
Sleeping
| # FinBot Assignment 1 - Master Documentation Index | |
| ## π Complete Documentation Navigation | |
| Welcome to FinBot! This is your comprehensive RAG system with RBAC enforcement. Below is a guide to all documentation files and where to find what you need. | |
| --- | |
| ## π Getting Started (5 minutes) | |
| ### First Time? Start Here | |
| 1. **[SETUP_NEXTJS.md](SETUP_NEXTJS.md)** β Quick start guide (5 minutes) | |
| - Installation instructions | |
| - Setup checklist | |
| - How to login with 5 demo users | |
| - Basic test queries | |
| ### Prefer Simple Setup? | |
| - Use the legacy HTML/JS frontend (no npm required) | |
| - Just open `app/frontend/index.html` in browser | |
| - See [README.md](README.md) section "Start Frontend" for details | |
| --- | |
| ## π Comprehensive Guides (Read in This Order) | |
| ### 1οΈβ£ Main README - System Architecture & APIs | |
| **[README.md](README.md)** (500+ lines) | |
| - β Complete system overview | |
| - β Business problem & solution | |
| - β Architecture diagram | |
| - β Detailed setup instructions (steps 1-6) | |
| - β API reference (9 endpoints) | |
| - β Demo user list | |
| - β RAGAs evaluation results | |
| - β Tool justifications | |
| - β Evaluation criteria checklist | |
| **When to read**: After getting FinBot running, to understand how everything fits together | |
| ### 2οΈβ£ Complete System Guide - Deep Dive | |
| **[COMPLETE_SYSTEM_GUIDE.md](COMPLETE_SYSTEM_GUIDE.md)** (600+ lines) | |
| - β End-to-end system architecture | |
| - β All 5 component descriptions: | |
| - RBAC Enforcement | |
| - Hierarchical Chunking | |
| - Semantic Routing | |
| - Input Guardrails | |
| - Output Guardrails | |
| - β Complete file inventory | |
| - β 5 demo users explained | |
| - β Test queries by collection | |
| - β Performance metrics | |
| - β Deployment scenarios | |
| - β Security checklist | |
| **When to read**: Want to understand each component deeply, or planning deployment | |
| ### 3οΈβ£ NextJS Frontend Documentation | |
| **[app/frontend-nextjs/README.md](app/frontend-nextjs/README.md)** (300+ lines) | |
| - β Frontend-specific features | |
| - β Component descriptions | |
| - β Styling with Tailwind | |
| - β Admin panel guide | |
| - β API integration details | |
| - β Troubleshooting | |
| - β Deployment options | |
| **When to read**: Working with frontend, customizing UI, or deploying | |
| ### 4οΈβ£ Demo Video Recording Guide | |
| **[DEMO_VIDEO_GUIDE.md](DEMO_VIDEO_GUIDE.md)** (400+ lines) | |
| - β Assignment requirement explaining | |
| - β 5 key demo scenarios: | |
| - RBAC Enforcement (0:00-1:00) | |
| - Guardrail Triggers (1:00-2:00) | |
| - Source Citations (2:00-3:00) | |
| - User Role Display (3:00-3:30) | |
| - Semantic Routing (3:30-4:00) | |
| - β Complete 4-minute demo script | |
| - β Recording setup tips | |
| - β Post-production checklist | |
| - β Troubleshooting demo issues | |
| **When to read**: Recording your demo video (4-5 minutes) | |
| ### 5οΈβ£ NextJS Frontend Summary | |
| **[NEXTJS_FRONTEND_SUMMARY.md](NEXTJS_FRONTEND_SUMMARY.md)** (400+ lines) | |
| - β All 20+ files created listed | |
| - β Component descriptions | |
| - β Features checklist | |
| - β Design features | |
| - β Technology stack | |
| - β Testing scenarios | |
| - β 2,400 lines of code summary | |
| **When to read**: Understand what was built, or diving into code | |
| --- | |
| ## π Project Structure at a Glance | |
| ``` | |
| Assignment1/ | |
| βββ π README.md β START HERE (main guide) | |
| βββ π SETUP_NEXTJS.md β Quick 5-min setup | |
| βββ π COMPLETE_SYSTEM_GUIDE.md β Deep dive guide | |
| βββ π DEMO_VIDEO_GUIDE.md β Demo recording help | |
| βββ π NEXTJS_FRONTEND_SUMMARY.md β What was built | |
| β | |
| βββ π app/ | |
| β βββ π backend/ β Python FastAPI server | |
| β β βββ config.py (450 lines) | |
| β β βββ metadata_schema.py (200 lines) | |
| β β βββ vector_store.py (300 lines) | |
| β β βββ main.py (250 lines - 9 API endpoints) | |
| β β βββ π ingestion/ (500+ lines) | |
| β β βββ π retrieval/ (400+ lines) | |
| β β βββ π routing/ (400+ lines) | |
| β β βββ π guardrails/ (600+ lines) | |
| β β βββ π pipeline/ (350 lines) | |
| β β βββ requirements.txt (17 dependencies) | |
| β β | |
| β βββ π frontend/ β Simple HTML/JS (no build) | |
| β β βββ index.html (280 lines) | |
| β β βββ app.js (340 lines) | |
| β β βββ style.css (520 lines) | |
| β β | |
| β βββ π frontend-nextjs/ β ProNextJS frontend β | |
| β βββ π app/ | |
| β β βββ layout.tsx | |
| β β βββ page.tsx | |
| β β βββ globals.css | |
| β βββ π components/ (6 React components) | |
| β β βββ LoginScreen.tsx (280 lines) | |
| β β βββ ChatInterface.tsx (450 lines) | |
| β β βββ ChatMessage.tsx (300 lines) | |
| β β βββ AdminPanel.tsx (550 lines) | |
| β β βββ GuardrailBanner.tsx (80 lines) | |
| β β βββ RBACBlock.tsx (60 lines) | |
| β βββ π lib/ | |
| β β βββ api.ts (120 lines) | |
| β β βββ types.ts (200 lines) | |
| β β βββ constants.ts (80 lines) | |
| β βββ package.json | |
| β βββ tsconfig.json | |
| β βββ tailwind.config.js | |
| β βββ README.md | |
| β | |
| βββ π data/ β Source documents | |
| β βββ π general/ | |
| β βββ π finance/ β Finance documents | |
| β βββ π engineering/ β Engineering documentation | |
| β βββ π marketing/ β Marketing reports | |
| β βββ π hr/ β HR documents | |
| β | |
| βββ π evaluation/ β Testing & evaluation | |
| βββ test_dataset.py (40+ QA pairs) | |
| βββ eval_ablation.py (RAGAs evaluation) | |
| ``` | |
| --- | |
| ## π― Common Tasks & Where to Find Info | |
| ### "How do I get started?" | |
| β Read [SETUP_NEXTJS.md](SETUP_NEXTJS.md) (5 minutes) | |
| ### "How do I demo RBAC enforcement?" | |
| β Read [DEMO_VIDEO_GUIDE.md](DEMO_VIDEO_GUIDE.md) section "RBAC Enforcement" | |
| ### "What API endpoints are available?" | |
| β Read [README.md](README.md) section "API Reference" | |
| ### "How do I create a new user?" | |
| β Use Admin Panel in NextJS frontend, or read ChatInterface component code | |
| ### "How does RBAC work internally?" | |
| β Read [COMPLETE_SYSTEM_GUIDE.md](COMPLETE_SYSTEM_GUIDE.md) section "RBAC Enforcement" | |
| ### "What's the difference between the 2 frontends?" | |
| β Read [README.md](README.md) section "Start Frontend" | |
| ### "How do I deploy this?" | |
| β Read [COMPLETE_SYSTEM_GUIDE.md](COMPLETE_SYSTEM_GUIDE.md) section "Deployment Scenarios" | |
| ### "What test queries should I try?" | |
| β Read [COMPLETE_SYSTEM_GUIDE.md](COMPLETE_SYSTEM_GUIDE.md) section "Test Queries by Collection" | |
| ### "How do I record my demo video?" | |
| β Read [DEMO_VIDEO_GUIDE.md](DEMO_VIDEO_GUIDE.md) (complete script + tips) | |
| ### "What's in the NextJS frontend?" | |
| β Read [NEXTJS_FRONTEND_SUMMARY.md](NEXTJS_FRONTEND_SUMMARY.md) | |
| ### "What guardrails are implemented?" | |
| β Read [README.md](README.md) section "Guardrails Layer" | |
| --- | |
| ## π Quick Reference | |
| ### 5 Demo Users | |
| | User | Username | Role | Access | | |
| |------|----------|------|--------| | |
| | John Employee | emp_john | employee | General | | |
| | Alice Finance | fin_alice | finance | General, Finance | | |
| | Bob Engineer | eng_bob | engineering | General, Engineering | | |
| | Carol Marketing | mkt_carol | marketing | General, Marketing | | |
| | Dave C-Level | ceo_dave | c_level | ALL | | |
| ### 5 Collections | |
| - **General**: Company policies, FAQs (all roles) | |
| - **Finance**: Revenue, budgets, margins (finance, c_level) | |
| - **Engineering**: Architecture, APIs, SLAs (engineering, c_level) | |
| - **Marketing**: Campaigns, brand, competitors (marketing, c_level) | |
| - **HR**: Leave, benefits, culture (employee, c_level) | |
| ### 4 Key Test Scenarios | |
| 1. **RBAC Denial**: Ask finance Q as marketing user β Access Denied | |
| 2. **Guardrail Block**: Try prompt injection β Blocked with warning | |
| 3. **Source Citation**: Ask any Q β See document sources with page numbers | |
| 4. **Admin Panel**: Create new user β See in user list | |
| --- | |
| ## π Recommended Reading Path | |
| ``` | |
| 1. First visit? Start with SETUP_NEXTJS.md (5 min) | |
| ββ Get FinBot running, login, try demo users | |
| 2. Want to understand? Read README.md (30-45 min) | |
| ββ System architecture, APIs, evaluation | |
| 3. Need deep dive? Read COMPLETE_SYSTEM_GUIDE.md (30-45 min) | |
| ββ All components, files, deployment | |
| 4. Recording demo? Read DEMO_VIDEO_GUIDE.md (15 min prep) | |
| ββ Script, scenarios, recording tips | |
| 5. Customizing? Read NEXTJS_FRONTEND_SUMMARY.md (20 min) | |
| ββ Components, styling, features | |
| ``` | |
| **Total read time**: ~2-3 hours for full understanding | |
| **To get running**: ~10 minutes (5 min setup + 5 min exploring) | |
| --- | |
| ## π Quick Start Recap | |
| ### Backend (Terminal 1) | |
| ```bash | |
| cd app/backend | |
| pip install -r requirements.txt | |
| export GROQ_API_KEY="gsk-..." # Add your key | |
| python -c "from ingestion.document_ingester import main; main()" | |
| uvicorn main:app --reload | |
| # Visit http://localhost:8000/docs for API documentation | |
| ``` | |
| ### Frontend (Terminal 2) | |
| ```bash | |
| cd app/frontend-nextjs | |
| npm install | |
| npm run dev | |
| # Visit http://localhost:3000 in browser | |
| # Login with any demo user | |
| ``` | |
| ### Test RBAC | |
| 1. Login as `mkt_carol` | |
| 2. Ask: "What was Q3 revenue?" | |
| 3. See: ACCESS DENIED β | |
| 4. Logout, login as `fin_alice` | |
| 5. Ask: "What was Q3 revenue?" | |
| 6. See: Answer with sources β | |
| --- | |
| ## π Need Help? | |
| | Question | Answer | Location | | |
| |----------|--------|----------| | |
| | How do I... | Installation | SETUP_NEXTJS.md | | |
| | What is... | Architecture/design | README.md or COMPLETE_SYSTEM_GUIDE.md | | |
| | How do I... | Demo video | DEMO_VIDEO_GUIDE.md | | |
| | What was... | Built/components | NEXTJS_FRONTEND_SUMMARY.md | | |
| | Where do I... | Find API docs | README.md (API Reference) | | |
| | How do I... | Deploy | COMPLETE_SYSTEM_GUIDE.md (Deployment) | | |
| --- | |
| ## β Evaluation Checklist | |
| Use this to verify everything works for assignment submission: | |
| - β Backend running on `http://localhost:8000` | |
| - β Frontend running on `http://localhost:3000` | |
| - β Can login with 5 demo users | |
| - β Chat interface works and shows answers | |
| - β RBAC denial shown when trying restricted content | |
| - β Guardrail warnings appear for injected prompts | |
| - β Sources shown with page numbers | |
| - β Semantic route displayed | |
| - β User role and access shown in sidebar | |
| - β Admin panel works (can create users) | |
| - β System health shows "healthy" | |
| - β All 5 collections available | |
| - β Demo video recorded (4-5 minutes) | |
| - β Video shows RBAC denial + guardrail trigger | |
| - β README.md explains everything | |
| - β RAGAs evaluation results present | |
| --- | |
| ## π Learning Resources | |
| To understand the technologies used: | |
| - **Next.js**: https://nextjs.org/docs | |
| - **React**: https://react.dev | |
| - **TypeScript**: https://www.typescriptlang.org/docs/ | |
| - **Tailwind CSS**: https://tailwindcss.com/docs | |
| - **FastAPI**: https://fastapi.tiangolo.com/ | |
| - **RAG Systems**: https://www.deeplearning.ai/short-courses/ | |
| - **RBAC**: https://en.wikipedia.org/wiki/Role-based_access_control | |
| --- | |
| ## π Summary | |
| **FinBot** is a complete RAG system demonstrating: | |
| - β 6,000+ lines of Python (backend) | |
| - β 2,400+ lines of React/TypeScript (frontend) | |
| - β 1,000+ lines of documentation | |
| - β RBAC enforcement at DB level | |
| - β Semantic routing with 5 intent routes | |
| - β Dual-layer guardrails (input + output) | |
| - β Professional admin panel | |
| - β RAGAs evaluation with ablations | |
| - β Production-ready architecture | |
| **Everything is documented, tested, and ready for evaluation!** | |
| --- | |
| **Navigate using the table of contents at the top, or use the recommended reading path above.** | |
| **Good luck with your assignment! π** | |