Sections

RAG search (mobile)

Retrieval-augmented answering: semantic retrieval, LLM rerank, then generated answer from top sections. Requires app-key header. Optional header: X-Session-Id (identifies mobile; used for metrics and queries-per-session). Returns answer plus source sections.

post/v1/sections/search

Request

  • Base URL: https://api.federallabs.org (the document declares no server; this is the origin it was published from)
  • URL: https://api.federallabs.org/v1/sections/search
  • Auth: API key in header app-key

Headers

x-session-idstring required

Request body

querystring required

Search query message (e.g. user question or topic)

limitnumber

Maximum number of sections to return (default: 10, max: 50)

Example request

{
  "query": "What are the penalties for tax evasion?"
}

Response

Generated answer and source sections ordered by relevance

answerstring required

RAG-generated answer based on retrieved sections

cacheIdnumber

Cache entry id; use this to submit feedback (accepted/rejected) via POST /v1/sections/query-cache/:id/feedback

Example response

{
  "answer": "According to the retrieved sections, penalties for tax evasion include...",
  "sections": [
    {
      "score": 0.87
    }
  ],
  "cacheId": 42
}

Changes

No recorded changes to this operation across all 1 revision of this API.