The pipeline
| Step | What it does | Why itâs there |
|---|---|---|
| Classify | A heuristic (deliberately not an LLM) picks a strategy and extracts filters | Classification runs on every query; cheap and deterministic beats smart and slow here |
| Expand | The query is reformulated into variants, each embedded | One phrasing of a question shouldnât decide whatâs findable |
| Structured | SQL conditions on rule fields | Exact filters: process, step, confidence, review status |
| Full-text | BM25 ranking | Catches literal tokens semantics miss: IDs, names, error codes |
| Literal semantic | Vector similarity against what each claim says | Catches paraphrase keyword search misses |
| Inferred semantic | Vector similarity against what each claim implies | âWho can sign this?â should find an approval rule that never uses the word âsignâ |
| Outcome signal | Boosts candidates whose rules observably hold in live events | Knowledge thatâs followed in practice outranks knowledge thatâs merely written down |
| Rank fusion | Merges the rank streams by position, not by score | Scores from different signals arenât comparable; ranks are |
| Rerank | A cross-encoder re-scores queryâresult pairs | Fusion gets the right candidates into the pool; reranking gets the best ones to the top |
| Graph + parent expansion | Walks related knowledge and attaches surrounding process context | A rule without its process context is hard to interpret; the related rule one hop away is often the actual answer |
Degrades, never hard-fails
Querying degrades gracefully when optional dependencies are missing:| Missing | Behaviour |
|---|---|
| Embedding provider | Semantic signals contribute nothing; full-text and structured signals still answer |
| Reranker | A passthrough preserves fusion order |
| Outcome data | The outcome signal contributes nothing until rules have observations |
Choosing a strategy
The classifier picks automatically (auto), but API callers can force one:
| Strategy | Use when | Tradeoff |
|---|---|---|
structured | The query maps to known fields (ârules in the loan process with confidence above 0.8â) | Precise, but blind to semantics |
hybrid | Natural-language questions. The default workhorse | Balanced; costs a rerank call |
graph | Exploring connections (âwhatâs related to this approval rule?â) | Surfaces structure; weaker for direct Q&A |
Explain mode
Passexplain=true (or use the dashboardâs Query Explorer) and every result carries its attribution: which signals matched it, at what ranks, and what fusion and reranking did to its position. When someone asks âwhy did chat say that?â, the explain output is the answer. Itâs the query-side analogue of the provenance chain.
Tuning heuristics
- Start with
auto. Forcehybridonly when the classifier visibly picks wrong; check explain output first. - Queries with literal tokens (IDs, error codes, project names) lean on full-text matching. If such queries underperform, confirm the term actually appears in rule text rather than only in raw records.
topKdefaults are conservative. Raise toward 20â50 for synthesis-style consumers (an agent summarising a topic); keep low for direct Q&A.- Filter by
reviewStatusfor production integrations. Querying ranks by relevance, not by whether a human approved the rule.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| A rule you can see in the dashboard never surfaces | Itâs in a draft or archived library, or its indexes postdate your query | Check the active library version; re-run extraction to refresh indexes |
| Exact ID search returns fuzzy results | Semantic signals dominate short queries | Use the structured strategy or a field filter for lookups |
| Scores look âlowâ across the board | Scores are relative ranking values, not absolute confidence; the top hit is the best available, not â90% certainâ | Compare within a result set, never across queries |
| Chat answers ignore obviously relevant knowledge | Chat queries before generating; if the query misses, generation canât recover | Debug with Query Explorerâs explain mode, not by re-phrasing chat prompts |
Related
Chat
The biggest consumer of this pipeline.
Knowledge
The substrate and indexes this pipeline searches.