Skip to content

RAG: /doc search — member-facing search over retrieval #210

Description

@qiuethan

Blocked by

#176

What

A /doc search subcommand on the existing /doc group: a member types a query, and gets back matching documents with citations, using the retrieval endpoint directly.

Why

Every other sub-issue in the RAG epic (#125) is plumbing. Without this one the epic can complete in full and no member notices anything changed — the capability only becomes visible when the helper bot (#81) wires it up, which is a much larger piece of work sitting behind it.

That is a bad shape for a student org with rotating contributors. It makes an eight-issue epic impossible to demo, hard to justify prioritizing, and hard to hand to someone new. A thin search surface means retrieval is exercised by real members against real questions well before #81 starts, which is also the fastest way to find out whether retrieval is any good.

Concretely: today a member looking for a document either remembers it exists and uses /doc list, or asks in a channel and hopes. Search is the difference between a catalog and a filing cabinet nobody opens.

Area

bot, docs-system

Done looks like

  • /doc search <query> returns ranked matching documents with titles and links.
  • Results are scoped to what the asking member can actually see — a member with no grants gets nothing, not an error.
  • A query with no good match says so plainly rather than returning the least-bad document.
  • Retrieval being unavailable degrades to a clear message, matching how the bot's other clients handle a service being down.
  • Covered by tests in the same shape as the existing /doc subcommands, and runnable in the web playground.

Design notes

Follows the existing /doc command group and the bot's neutral command shape, so it works in both the Discord surface and npm run dev:web. New client method on the existing doc client rather than a new client.

The bot's established posture toward a dependency being down is degrade-with-a-message, not fail — DocUnavailable and DirectoryUnavailable already model this, and search should not invent a third pattern.

This is deliberately search, not chat. No LLM call in this path — the ranked results come straight from retrieval. Keeping the LLM out of it means this surface stays cheap, fast, and easy to reason about for authorization.

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/botDiscord botarea/docs-systemdocumentation-system service & content pipelinetype/featureNew capability or enhancement

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions