Commit 13c1bca
authored
Add retrieval docs, providers section, and example (#220)
* Add retrieval docs, providers section, and example
Document the retrieval-provider capability for v0.16.0, mirroring the
LLM documentation layout.
Concept page (concepts/retrieval.md): embedding and reranking, the
input_type query/document knob, batch chunking, and the nullable-usage
contract. Stays concept-focused and points to the providers section.
Retrieval Providers section (retrieval-providers/), parallel to
model-providers/: index.md (the bundled-providers catalog, the
EmbeddingProvider / RerankProvider contract, error categories, a minimal
example), tei.md (self-hosting Text Embeddings Inference for embeddings
and reranking, from a first docker run to a systemd production
deployment, with the providers wired to it), and authoring.md (a
provider skeleton, contract checklist, and the chunking / input_type /
observability concerns).
API reference (reference/retrieval.md) and nav entries for both new
sections; a retrieval entry in the README capabilities list.
Example (examples/retrieval-rag): a lunar-corpus retrieval-augmented
answering pipeline that batch-embeds a corpus, embeds the query,
retrieves by cosine similarity, reranks the shortlist, and grounds an
answer in the reranked passages, with an observer printing the embedding
and rerank events.
Exports the four retrieval event types (EmbeddingEvent,
EmbeddingFailedEvent, RerankEvent, RerankFailedEvent) top-level from
openarmature.graph, matching the LLM events, so observers over retrieval
calls import them the same way. Regenerates the bundled AGENTS.md
example index.
* Fix implicit string concat and skeleton 404 mapping
Address the review on PR #220. Wrap each retrieval-rag CORPUS passage in
parentheses so the multi-line string is an explicit grouped expression,
not adjacent string literals implicitly concatenated inside the list (a
CodeQL missing-comma footgun in a copy-me example). Add the
404 -> ProviderInvalidModel branch and import to the authoring-guide
skeleton's _classify(), which contradicted its own contract checklist.
* Use typed default_factory for SearchState list fields
Align the retrieval-rag SearchState list defaults with the codebase's
Field(default_factory=...) idiom (PR #220 review). Use the typed
default_factory=list[int] rather than a bare default_factory=list, since
the bare form infers list[Unknown] and trips strict pyright's
reportUnknownVariableType on a list[int] field.
* Drop stale example count from README
The Next Steps 'Examples' bullet hard-coded 'ten runnable demos', which
was already stale and this PR adds another. Remove the fixed number so it
stops drifting as examples change (PR #220 review).
* Map malformed 200 body to ProviderInvalidResponse in skeleton
The authoring-guide embed() skeleton parsed the 200 response body without
guarding it, so a malformed body would leak a raw KeyError/ValueError
instead of the ProviderInvalidResponse its own contract checklist
prescribes. Wrap the parse (PR #220 review).1 parent 66ba816 commit 13c1bca
12 files changed
Lines changed: 1203 additions & 2 deletions
File tree
- docs
- concepts
- reference
- retrieval-providers
- examples
- retrieval-rag
- src/openarmature
- graph
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments