Expand description
AI runtime modules.
Houses the LLM-touching pieces of the AskPipeline:
prompt_template— typed-slot prompt assembly with secret redaction and injection defence (issue #122).ner— opt-in LLM backend for AskPipeline Stage 1 entity extraction with auth gate, response sanitization, and a configurable heuristic fallback (issue #123).
Both modules are pure additions — call-site wiring lives in
super::ask_pipeline and is opt-in via ai.ner.backend = "llm"
at runtime config time.
Modules§
- answer_
cache_ key AnswerCacheKey— pure key derivation and TTL policy for the ASK answer cache.- ask_
response_ envelope AskResponseEnvelope— pure serializer for the canonical non-streaming ASK JSON response (issue #406, PRD #391).- audit_
record_ builder AuditRecordBuilder— pure builder forred_ask_auditrows.- batch_
client - Batch embedding client — issue #275.
- citation_
parser CitationParser— pure text-to-citations extractor.- cost_
guard CostGuardEvaluator— pure ASK resource-cap policy.- dedup_
cache - Embedding dedup cache — issue #277.
- determinism_
decider DeterminismDecider— pure resolution oftemperature+seed.- explain_
plan_ builder ExplainPlanBuilder— pure JSON plan synthesis forEXPLAIN ASK '...'.- grpc_
ask_ message GrpcAskMessage— pure builder pinning the typed gRPCAskReplyshape (issue #407, PRD #391).- mcp_
ask_ tool McpAskTool— pure descriptor + arg parser for exposingASK '...'as an MCP tool (issue #409, PRD #391).- metrics
- AI metrics — issue #280.
- ner
- LLM-based NER for AskPipeline Stage 1 — issue #123.
- pg_
wire_ ask_ row_ encoder PgWireAskRowEncoder— pure encoder that turns anAskResultinto the single-row Postgres-wire result set that #408 exposes to psycopg / pgx / JDBC.- prompt_
assembler PromptAssembler— pure composition of (system_prompt, sources, question) → final prompt text (issue #397).- prompt_
template PromptTemplate— typed-slot prompt assembly for the AskPipeline synthesis stage with provider-tier matrix, secret redaction, and injection defence (issue #122, PRD #118).- provider_
capabilities ProviderCapabilityRegistry— pure provider capability lookup.- provider_
failover ProviderFailover— pure ordered-list failover kernel for ASK.- rrf_
fuser RrfFuser— pure Reciprocal Rank Fusion for ASK hybrid retrieval.- sources_
fingerprint SourcesFingerprint— pure stable hash over the retrieved source set.- sse_
frame_ encoder SseFrameEncoder— pure Server-Sent Events frame serializer forASK '...' STREAMover HTTP.- strict_
validator StrictValidator— pure citation validation policy.- text_
chunker - Text chunker — issue #277.
- transport
- Shared async HTTP transport foundation for AI providers.
- urn_
codec - URN codec for ASK source references (issue #394).