117 lines
2.2 KiB
Markdown
117 lines
2.2 KiB
Markdown
# 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/upload`
|
|
- `POST /api/rag/match-job` -> `cv-matcher-api /api/cv/match-job`
|
|
|
|
Required public API config:
|
|
|
|
```json
|
|
"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/upload`
|
|
- `POST /api/cv/match-job`
|
|
- `POST /api/cv/find-jobs`
|
|
- `GET /health`
|
|
- Swagger: `/swagger`
|
|
|
|
Responsibilities:
|
|
|
|
- CV matcher business logic
|
|
- job URL/text extraction
|
|
- final LLM scoring
|
|
- result persistence
|
|
- email sending
|
|
- calls `rag-api` for generic semantic indexing/search
|
|
|
|
## `rag-api`
|
|
|
|
Generic semantic search API.
|
|
|
|
Main endpoints:
|
|
|
|
- `POST /api/rag/documents`
|
|
- `POST /api/rag/documents/json`
|
|
- `POST /api/rag/search`
|
|
- `GET /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:
|
|
|
|
```json
|
|
"Swagger": {
|
|
"Enabled": false
|
|
}
|
|
```
|
|
|
|
## Internal API security
|
|
|
|
Both internal APIs support API-key protection:
|
|
|
|
```json
|
|
"InternalApi": {
|
|
"RequireApiKey": true,
|
|
"ApiKey": "change-this-internal-key"
|
|
}
|
|
```
|
|
|
|
Requests must include:
|
|
|
|
```http
|
|
X-Internal-Api-Key: change-this-internal-key
|
|
```
|