Technical architecture

Research prototype with strict source-support gates.

Kira retrieves evidence, drafts cautiously, checks citations, and records where answers fail. The site shows strict unsupported claims, refusals, broad relevance flags, and corpus limits separately.

Grounding loop

A research prototype with strict source-support gates.

MoodSpan records enough evidence to inspect why an answer passed, became a partial answer, or was refused. The useful story is source support, failure visibility, and clear limits.

n/a

Strict unsupported

n/a / n/a stored rows

n/a

Refusals

n/a / n/a stored rows

n/a

Broad relevance flags

n/a / n/a stored rows

Hybrid quarantine

Corpus path

0 tracked files; curated set of N articles

1

Draft

Kira drafts from retrieved evidence and inline source IDs.

2

Contract

Citation coverage, sentence support, and retrieval confidence are checked before release.

3

Salvage

Source-bound sentences can be kept; unsupported extras are removed or refused.

4

Audit

Eval payloads preserve original draft, final answer, failed sentences, source index, and retrieval snippets.

Latest credentialed eval promoted

Strict unsupported is n/a, refusals are n/a, and broad relevance flags are n/a. Remaining work starts with the flagged broad-relevance rows.

original draftfinal answerretrieval snippets
Search pipeline

Eight stages from query to grounded response.

Each query passes through synonym expansion, dual-path retrieval, score-fusion ranking, and tool orchestration before answer drafting with safety constraints.

Query

0ms

User input parsed and classified

Expansion

~1ms

80+ clinical synonym mappings

Embedding

~50ms

384-dim dense vectors

Hybrid Search

~20ms

60% vector + 40% BM25 fusion

Reranking

~300ms

Cross-encoder 20 → 8

Tool Loop

~1.5s

4 tools, max 3 rounds

Safety

In-prompt

Safety constraints + output guard

Response

~2s total

SSE stream with sources

Retrieval benchmarks

Measured against 438 gold queries across five evaluation categories.

Scope, clinical depth, differential diagnosis, safety, and edge cases - each with bootstrap 95% confidence intervals.

System architecture

The numbers behind the pipeline.

Knowledge Base

88

DSM-5-TR disorders

8,753

Search chunks

10

Personality disorders

25

Screener instruments

Search Pipeline

384d

Embedding dimensions

60/40

Vector / BM25 weight

80+

Synonym mappings

20→8

Candidates → results

Safety Pipeline

3-tier

Safety classification

988

Crisis escalation

20/min

Rate limit burst

In-prompt

Safety principles

Evaluation

438

Gold evaluation queries

92%

Recall@5

4.55

Groundedness (of 5)

4.91

Relevance (of 5)

Ablation study

Each component earns its place in the pipeline.

Retrieval quality across search methods, measured on queries with known expected sources and bootstrap confidence intervals.

MethodRecall@3Recall@5Recall@8MRRNDCG@10
BM25 Only
- - - - -
Hybrid (Vector + BM25)Production
- - - - -
Hybrid + Reranking
- - - - -

Hybrid fusion uses 60/40 vector/BM25 weighting with reciprocal rank fusion. Bootstrap 95% CIs computed over 1,000 resamples of the 107-query test split. Reranking adds ~300ms latency for marginal gains - disabled in production.

Knowledge graph

Clinical relationships extracted from structured DSM-5-TR data.

Interactive visualization of comorbidity links, screening tool associations, differential rule-outs, and diagnostic category membership across 57 conditions and 44 instruments.

Explore the system

Try Kira on hard clinical questions and see the pipeline in action.

Ask about differential diagnosis, comorbidity patterns, screening interpretation, or treatment mechanisms - every answer is grounded in the knowledge base with source citations.