2.2 KiB
2.2 KiB
MyAi RAG split cleanup
Public api
The existing api project is now only the public gateway for the existing frontend.
It keeps:
- contact API
- file download API
- Google/config APIs
- health API
api/rag/*proxy endpoints
It no longer contains local RAG processing code. The removed responsibilities are:
- PDF extraction
- chunking
- embeddings
- vector storage
- OpenAI/Ollama calls
- job text extraction
- CV matching business logic
api/Controllers/RagController.cs is intentionally kept. It proxies the current frontend calls:
POST /api/rag/cv->cv-matcher-api /api/cv/uploadPOST /api/rag/match-job->cv-matcher-api /api/cv/match-job
Required public API config:
"CvMatcherApi": {
"BaseUrl": "http://cv-matcher-api:8080",
"InternalApiKey": "change-this-internal-key"
}
cv-matcher-api
Business API for CV/job workflows.
Main endpoints:
POST /api/cv/uploadPOST /api/cv/match-jobPOST /api/cv/find-jobsGET /health- Swagger:
/swagger
Responsibilities:
- CV matcher business logic
- job URL/text extraction
- final LLM scoring
- result persistence
- email sending
- calls
rag-apifor generic semantic indexing/search
rag-api
Generic semantic search API.
Main endpoints:
POST /api/rag/documentsPOST /api/rag/documents/jsonPOST /api/rag/searchGET /api/rag/documents/{id}GET /health- Swagger:
/swagger
Responsibilities:
- generic document indexing
- automatic document type classification when type is missing
- PDF/text extraction
- chunking
- embedding creation
- embedding and chat completion cache
- semantic search over generic documents
Logging and Swagger
All three APIs now have:
- Serilog startup logging
- Serilog request logging
- structured JSON console logs
- health endpoint
- Swagger/OpenAPI support
Swagger is enabled by default and can be disabled per service with:
"Swagger": {
"Enabled": false
}
Internal API security
Both internal APIs support API-key protection:
"InternalApi": {
"RequireApiKey": true,
"ApiKey": "change-this-internal-key"
}
Requests must include:
X-Internal-Api-Key: change-this-internal-key