Production-ready .NET 8 RAG backend with:
- document upload (
.pdfand.txt) - chunking + embeddings generation
- Pinecone vector upsert/query
- question answering endpoint constrained to retrieved context
- unit tests and CI in GitHub Actions
backend/RAGService/RAGService- API projectbackend/RAGService/RAGService.Tests- unit tests.github/workflows/ci.yml- CI pipeline (restore/build/test)
- .NET SDK 8.x
- OpenAI API key
- Pinecone index and API key
Set values in backend/RAGService/RAGService/appsettings.json or via environment variables:
OpenAI__ApiKeyOpenAI__BaseUrl(default:https://api.openai.com/v1/)OpenAI__EmbeddingModel(default:text-embedding-3-small)OpenAI__ChatModel(default:gpt-4o-mini)Pinecone__ApiKeyPinecone__BaseUrlPinecone__DefaultTopK
cd backend/RAGService
dotnet restore
dotnet run --project RAGService/RAGService.csprojSwagger UI is available in development mode.
cd backend/RAGService
dotnet test RAGService.slnPOST /api/documents/upload(multipart form-data, fieldfile)POST /api/queries/ask(JSON body:{ "question": "..." })GET /health