1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! HTTP API Handlers and Routes
//!
//! This module provides the REST API layer for A.R.E.S, built on the Axum web framework.
//!
//! # Module Structure
//!
//! - [`api::handlers`](crate::api::handlers) - Request handlers for each endpoint
//! - [`api::routes`](crate::api::routes) - Route definitions and router configuration
//!
//! # API Endpoints
//!
//! ## Authentication (`/api/auth`)
//! - `POST /api/auth/register` - Register new user
//! - `POST /api/auth/login` - Login and receive JWT token
//!
//! ## Chat (`/api/chat`)
//! - `POST /api/chat` - Send message and receive streaming response
//! - `GET /api/memory` - Get user memory (facts, preferences)
//!
//! ## Conversations (`/api/conversations`)
//! - `GET /api/conversations` - List user's conversations
//! - `GET /api/conversations/{id}` - Get conversation with messages
//! - `PUT /api/conversations/{id}` - Update conversation title
//! - `DELETE /api/conversations/{id}` - Delete conversation
//!
//! ## RAG (`/api/rag`)
//! - `POST /api/rag/ingest` - Ingest documents into a collection
//! - `POST /api/rag/search` - Search for relevant documents
//! - `GET /api/rag/collections` - List collections
//! - `DELETE /api/rag/collections/{name}` - Delete a collection
//!
//! ## Health (`/api/health`)
//! - `GET /api/health` - Health check endpoint
//!
//! # Authentication
//!
//! Most endpoints require a valid JWT token in the `Authorization` header:
//! ```text
//! Authorization: Bearer <token>
//! ```
//!
//! # OpenAPI Documentation
//!
//! When the `swagger-ui` feature is enabled, interactive API documentation
//! is available at `/swagger-ui/`.
/// Request and response handlers for all API endpoints.
/// Router configuration and route definitions.