HTTP Server

When the `server` feature is enabled, `forgetless-server` exposes a multipart API on port `8080` with `POST /` and `GET /health`.

Start the server

1cargo run --features server --bin forgetless-server

The server uses Axum, enables permissive CORS through `tower-http`, and raises the multipart body limit to 50 MB.

Request shape

FieldTypeMeaning
metadataJSON stringContains `max_tokens`, optional `query`, and inline text contents.
fileMultipart fileUploaded with medium priority.
file:criticalMultipart fileUploaded with critical priority.
file:highMultipart fileUploaded with high priority.
file:lowMultipart fileUploaded with low priority.
1{
2 "max_tokens": 128000,
3 "query": "Summarize the main architectural changes",
4 "contents": [
5 { "content": "You are preparing release notes.", "priority": "critical" },
6 { "content": "Keep the answer short.", "priority": "high" }
7 ]
8}

Response shape

1{
2 "content": "## system.md\nInstructions...\n\n---\n\n## review.pdf\nKey findings...",
3 "total_tokens": 45211,
4 "compression_ratio": 2.79,
5 "stats": {
6 "input_tokens": 126000,
7 "output_tokens": 45211,
8 "chunks_processed": 89,
9 "chunks_selected": 32,
10 "processing_time_ms": 1250
11 }
12}