How leoxramadani/ragapidotnetollama works
This is an ASP.NET RAG API for indexing PDF, text, and Excel documents, answering questions from retrieved document chunks, and evaluating retrieval and answer faithfulness. The main workflows are document upload through extraction, chunking, embedding, and Qdrant storage; and question submission through retrieval, prompt construction, and OpenAI generation. Document listing and deletion, plus evaluation, are separate capabilities. Evaluation and controller behavior are based on the source index references where their implementations were not excerpted.
Main entry points: RagService.cs RAG workflow · IngestionService.cs Ingestion · EvaluationService.cs Evaluation · VectorStoreService.cs Vector store
Components 16
API endpoints
- Documents API
Controllers/DocumentsController.cs - Questions API
Controllers/QuestionsController.cs - Evaluation API
Controllers/EvaluationController.cs
Document ingestion
- Ingestion
Services/IngestionService.cs - Text extraction
Services/DocumentTextExtractor.cs - Text splitting
Services/RecursiveTextSplitter.cs
Question answering
- RAG workflow
Services/RagService.cs - RAG prompts
Services/RagPrompts.cs
Evaluation
- Evaluation
Services/EvaluationService.cs
Models and integrations
- Embeddings
Services/EmbeddingService.cs - Vector store
Services/VectorStoreService.cs - Qdrant
- OpenAI
- Request and result models
Models/Models.cs - Service options
Options/Options.cs
Other components
- API client
Connections 23
- API client → Documents API: uploads or manages
Controllers/DocumentsController.cs - API client → Questions API: asks question
- API client → Evaluation API: requests evaluation
- Documents API → Ingestion: ingests upload
Controllers/DocumentsController.cs - Documents API → Vector store: lists or deletes
Controllers/DocumentsController.cs - Ingestion → Text extraction: extracts text
Services/IngestionService.cs - Ingestion → Text splitting: splits text
Services/IngestionService.cs - Ingestion → Embeddings: embeds chunks
Services/IngestionService.cs - Ingestion → Vector store: stores chunks
Services/IngestionService.cs - Text extraction → Request and result models: returns extracted document
Services/DocumentTextExtractor.cs - Embeddings → OpenAI: requests embeddings
Services/EmbeddingService.cs - Vector store → Qdrant: reads and writes
Services/VectorStoreService.cs - Questions API → RAG workflow: answers question
Controllers/QuestionsController.cs - RAG workflow → Vector store: checks and searches
Services/RagService.cs - RAG workflow → Embeddings: embeds question
Services/RagService.cs - RAG workflow → RAG prompts: builds prompt
Services/RagService.cs - RAG workflow → OpenAI: generates answer
Services/RagService.cs - RAG workflow → Request and result models: returns answer and sources
Services/RagService.cs - Evaluation API → Evaluation: runs evaluation
Controllers/EvaluationController.cs - Evaluation → RAG workflow: retrieves and generates
Services/EvaluationService.cs - Evaluation → RAG prompts: builds context and checks fallback
Services/EvaluationService.cs - Evaluation → OpenAI: judges faithfulness
Services/EvaluationService.cs - Evaluation → Request and result models: returns report
Services/EvaluationService.cs