How ai-mentorship/debate-match-rag works
DebateMatch is an AI-assisted debate transcript explorer and question-answering system. Its principal workflow is a user submitting a question to the backend, which retrieves relevant debate passages and returns a grounded answer; a separate claim-checking route evaluates claims against external evidence. Transcript ingestion and indexing support these features, while the React frontend also provides transcript browsing and informational pages. The excerpts establish the backend’s retrieval and fact-checking calls, but do not show frontend-to-backend request wiring or the full ingestion/indexing call sequence, so those relationships are omitted or marked unverified.
Main entry points: main.py Flask application · App.jsx Page router · retriever.py Passage retrieval · AI_FactChecker.py Claim fact checker
Components 21
User interface
- Page router
src/frontend/src/App.jsx - Analyzer
src/frontend/src/pages/Analyzer.jsx - Transcript browser
src/frontend/src/pages/Transcripts.jsx - Home page
src/frontend/src/pages/Home.jsx - Mission page
src/frontend/src/pages/Missions.jsx - Team page
src/frontend/src/pages/Team.jsx - Navigation header
src/frontend/src/components/Header.jsx
Backend routes
- Flask application
src/main.py
Transcript ingestion
- Transcript cleaner
src/backend/preprocessing/preprocess_script.py - MongoDB collections
src/backend/database/connection.py - Transcript loader
src/backend/database/insert.py - FAISS index builder
src/backend/embeddings_faiss/build_index.py - Incremental indexing
src/backend/embeddings_faiss/incremental_index.py
Retrieval and analysis
- Passage retrieval
src/backend/retriever/retriever.py - RAG answer pipeline
src/backend/qa_pipeline/QA_pipeline.py - Claim fact checker
src/backend/fact_checker_prototype/AI_FactChecker.py - GPT client
src/backend/core_llm/gpt5_nano.py
Other components
- User
- OpenAI services
- Wikipedia API
- News API
Connections 24
- User → Page router: uses
- Page router → Navigation header: renders
src/frontend/src/App.jsx - Page router → Home page: routes
src/frontend/src/App.jsx - Page router → Analyzer: routes
src/frontend/src/App.jsx - Page router → Transcript browser: routes
src/frontend/src/App.jsx - Page router → Mission page: routes
src/frontend/src/App.jsx - Page router → Team page: routes
src/frontend/src/App.jsx - Transcript browser → User: shows transcripts
src/frontend/src/pages/Transcripts.jsx - Analyzer → Flask application: submits queries
- Flask application → Passage retrieval: retrieves passages
src/main.py - Flask application → Claim fact checker: checks claims
src/main.py - Flask application → RAG answer pipeline: generates answers
src/main.py - Flask application → Transcript cleaner: processes uploads
src/main.py - Flask application → Transcript loader: loads transcripts
src/main.py - Flask application → FAISS index builder: builds index
src/main.py - Flask application → Incremental indexing: updates index
src/main.py - Transcript loader → MongoDB collections: writes records
src/backend/database/insert.py - MongoDB collections → Transcript loader: connects through
src/backend/database/insert.py - Passage retrieval → OpenAI services: embeds queries
src/backend/retriever/retriever.py - Passage retrieval → FAISS index builder: searches index
- RAG answer pipeline → OpenAI services: embeds and generates
src/backend/qa_pipeline/QA_pipeline.py - Flask application → GPT client: uses client
src/main.py - Claim fact checker → Wikipedia API: searches evidence
src/backend/fact_checker_prototype/AI_FactChecker.py - Claim fact checker → News API: searches evidence