Skip to content

Complex Query Endpoint (POST /query/complex) #61

@ustyuzhaninky

Description

@ustyuzhaninky

Complex Query Endpoint (POST /query/complex)

Labels: stage-9, backend, api, retrieval, rag

Description

Expose the full pipeline through a single API endpoint that executes all complex query stages and returns a structured, ranked set of relevant contexts.

Requirements

Endpoint

POST /api/v1/query/complex

Input JSON

{
  "query": "your query here",
  "k": 5,
  "filters": { "tags": ["..."], "source": "..." }
}

Response JSON

  • structured query breakdown
  • retrieved contexts
  • provenance metadata
  • hybrid ranking scores
  • total latency
  • number of retrieval stages executed

Behavior

  • Requires authentication

  • Runs full pipeline:

    • classification
    • hybrid retrieval
    • deduplication
    • ranking
    • formatting

Acceptance Criteria

  • Complex Query endpoint implemented

  • Returns correct pipeline output structure

  • Handles malformed queries gracefully

  • Tests for:

    • simple queries
    • multi-part queries
    • comparative queries
  • OpenAPI docs updated

References

Parent: Stage 9 — Complex Query Handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIAPI of the appRAGRetrieval Augmented GenerationbackendFoundation of the AppretrievalGetting things from somewhere elsestage-9

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions