Conversation
This adds the core RAG (Retrieval-Augmented Generation) pipeline, a
composable metadata filter DSL, and an embedder interface with a
deterministic dummy implementation for offline testing.
New packages:
pkg/rag — Retriever, FormatContext, BuildPrompt with token-budget mgmt
pkg/embedder — Embedder interface + Dummy (FNV-hash, unit-norm)
pkg/embedx — Searcher interface + Filter DSL (Eq/In/Exists/And/Or/Not)
pkg/store/store — Public Store interface facade
internal/store/sqlite — Internal SQLite implementation
models/get-small.gtemodel — Binary model asset
Also included:
scripts/ascii-banner — Portable 3D-shadow ASCII banner with rainbow/solid/
per-letter color, NO_COLOR support, make install-banner
Makefile — install-banner target, help uses banner script
README.md — RAG/Filter/Embedder sections + v0.3.0 changelog
ROADMAP.md — v0.2.0-v0.3.0 marked done, v0.4.0 = RAG + Search
pkg/ann/ann.go - norms are now cached per node instead of being recomputed on every distance call -> search ~2x faster, index build ~2.4x faster, results bit-identical pkg/ann/recall_test.go (new) - recall@10 checks vs exact brute force on clustered + uniform data - regression floors so a recall drop fails CI - benchmarks: index build, search at ef=50/100/200, brute-force baseline pkg/rag/bench_test.go (new) - end-to-end Retrieve benchmark (embed + search over 1k docs) - FormatContext and BuildPrompt micro-benchmarks
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RAG pipeline, search filter DSL, embedder interface + HNSW ANN index
Summary
This PR adds the retrieval layer on top of the existing vector stores: a pure-Go HNSW approximate nearest neighbor index, a RAG pipeline with token-budget prompt assembly, a composable metadata filter DSL, and an embedder abstraction with an offline dummy implementation. It also ships a SQLite-backed store and updates docs/tooling.
What's new
🧠
pkg/ann— HNSW index (new)📚
pkg/rag— Retrieval-Augmented Generation building blocks (new)🔌
pkg/embedder(new) — Embedder interface + deterministic offline Dummy (FNV-hash, unit-norm) so pipelines are testable without model downloads🔍 pkg/embedx — Search config + Filter DSL (new) — Searcher interface, WithK/WithFilter options, composable filters (Eq/In/Exists/And/Or/Not)
📦 Storage
pkg/storefacade: single Store interface over all bundled backends🛠️ Tooling & docs
scripts/ascii-banner(portable, NO_COLOR-aware) + make install-bannerNotes for reviewers
models/get-small.gtemodeladds a ~21MB binary asset to the repo — flagging in case we'd rather use Git LFS or a download scriptpkg/ann/recall_test.gofor the accuracy envelopeTesting
go vet ./...clean; full suite passes under -race (12 packages)go test -bench . ./pkg/ann ./pkg/rag