Finding the right book excerpts
OnPassage retrieval is how Willow finds the right book excerpts for your message. It combines meaning-based search, keyword search, and reranking so technique guidance traces back to the clinician's guide — not just the model's general training.
242 indexed passages available (vector + keyword search, Voyage rerank).
When retrieval runs
Retrieval does not run on every short message. It activates when your turn is substantial enough to benefit from book context — for example, when you ask about a technique, mention homework or a thought record, ask how to do something, or write a longer reflective message.
Brief emotional check-ins and very short replies skip retrieval to keep responses fast and focused on the conversation, not a search index.
Hybrid search
Willow searches indexed passages two ways and merges the results:
- Meaning search (vector) — finds passages semantically similar to your message, even if you do not use the exact clinical terms.
- Keyword search (lexical) — finds passages that match specific words and phrases, useful for named techniques like "downward arrow" or "behavioral activation".
Reranking
After merging candidates from both searches, a reranking step scores each passage against your exact message and selects the best matches. This reduces noise — for example, when vector search returns broadly related content but keyword search found the precise technique section.
When reranking credentials are available, Willow uses Voyage rerank; otherwise it preserves merge order from the hybrid search.
How excerpts reach the reply
The top passages (typically up to five) are injected into the model's context before it generates a reply, with chapter, section, and page metadata. The model is instructed to use retrieved technique steps when they apply — for example, asking the next question in a thought record sequence aligned with the book.
Citations stay internal to the model context; Willow's visible replies remain conversational, not academic footnotes.
When retrieval is unavailable
- If embedding credentials are not configured, chat uses the written protocol and style only — no book passages.
- If the database is unavailable, passage counts cannot be verified and retrieval may be disabled.
- If no passages have been indexed yet, Willow still follows protocol and style rules but cannot ground technique detail in the guide.
Relationship to the other layers
Retrieval supplements the fixed cognitive behavioral therapy protocol and communication style — it does not replace them. Safety guardrails still run first; crisis language never waits for retrieval. The protocol defines what Willow will and will not do; retrieval supplies book-faithful detail for techniques within that scope.