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#

bash
cargo 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.
json
{
  "max_tokens": 128000,
  "query": "Summarize the main architectural changes",
  "contents": [
    { "content": "You are preparing release notes.", "priority": "critical" },
    { "content": "Keep the answer short.", "priority": "high" }
  ]
}

Response shape#

json
{
  "content": "## system.md\nInstructions...\n\n---\n\n## review.pdf\nKey findings...",
  "total_tokens": 45211,
  "compression_ratio": 2.79,
  "stats": {
    "input_tokens": 126000,
    "output_tokens": 45211,
    "chunks_processed": 89,
    "chunks_selected": 32,
    "processing_time_ms": 1250
  }
}