Phase 4 Mission:
Generate detailed API reference documentation for files, folders, knowledge base, and retrieval endpoints.

Prerequisites:
- api_docs/00_route_index.md must already exist (from Phase 1).

Source files to read (fully):
- backend/open_webui/routers/files.py          (~911 lines)
- backend/open_webui/routers/folders.py        (~351 lines)
- backend/open_webui/routers/knowledge.py      (~1139 lines)
- backend/open_webui/routers/retrieval.py      (~2820 lines — LARGEST FILE)
- backend/open_webui/models/files.py
- backend/open_webui/models/folders.py
- backend/open_webui/models/knowledge.py

Output files to create under api_docs/:
- 04_files.md
- 04_folders.md
- 04_knowledge.md
- 04_retrieval.md

Per-endpoint format:

---

### {HTTP_METHOD} {full_path}

**Summary:** One sentence description.

**Auth:** Admin only | Verified user | Public

**Request**

| Location | Field | Type | Required | Description |
|----------|-------|------|----------|-------------|
| Body | field_name | type | Yes/No | description |

*If no parameters, write: "No additional parameters."*

**Response `200`**

```json
{
  "example_field": "example_value"
}
```

| Field | Type | Description |
|-------|------|-------------|
| field_name | type | description |

**Error Responses**

| Status | Meaning |
|--------|---------|
| 401 | Not authenticated |
| 404 | Resource not found |

---

Special notes for this phase:

FILES:
- File upload uses multipart/form-data — document the form fields.
- File metadata response: id, filename, meta.content_type, size, user_id.
- File content endpoint: returns raw bytes — note Content-Type header behavior.

KNOWLEDGE:
- Knowledge base endpoints interact with vector store — note which ones trigger embedding/indexing.
- Document the "files" array in knowledge base objects (which file IDs are linked).
- Add/remove files from knowledge base: document the exact request shape.

RETRIEVAL:
- retrieval.py is 2820 lines; it configures the RAG pipeline (embedding models, chunk settings, etc.).
- Prioritize documenting: query endpoint, config GET/POST endpoints, embedding model endpoints.
- For config endpoints: document ALL configuration fields (chunk_size, chunk_overlap, top_k, etc.).
- Document the "process" endpoints (process_doc, process_web, process_youtube) with their request shapes.

Instructions:
1. Read ALL source files listed above.
2. For retrieval.py: focus on public API surface (router endpoints), not internal helper functions.
3. Document file upload endpoints with multipart form fields clearly marked.
4. Trace vector DB config models in retrieval.py to document all configurable fields.

Exit Criteria:
- 4 output files created.
- retrieval.py endpoints fully documented including all config fields.
- File upload endpoints show form-data field names.
- No placeholder or TBD.

Final output format:
- List of files created.
- Count of endpoints documented per file.
- Note any tricky schemas (nested config objects, etc.).
