Retrieval-Augmented Generation with Qdrant and Ollama
Find a file
Snider a550360321
All checks were successful
Security Scan / security (push) Successful in 6s
Test / test (push) Successful in 2m18s
chore: bump forge.lthn.ai dep versions to latest tags
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-26 05:34:23 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:08 +00:00
cmd/rag feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
docs docs: graduate TODO/FINDINGS into production documentation 2026-02-20 15:01:55 +00:00
tools/rag feat: add RAG Python tools from CLI 2026-02-21 21:16:54 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
benchmark_gpu_test.go fix: remove unused loop variables in GPU benchmark tests 2026-02-24 18:56:26 +00:00
benchmark_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
chunk.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
chunk_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
CLAUDE.md docs: graduate TODO/FINDINGS into production documentation 2026-02-20 15:01:55 +00:00
collections.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
collections_test.go feat: Phase 3 enhancements — sentence splitting, collection helpers, keyword filter, benchmarks 2026-02-20 08:02:00 +00:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
embedder.go feat: extract Embedder and VectorStore interfaces, add mock-based tests 2026-02-20 00:15:54 +00:00
go.mod chore: bump forge.lthn.ai dep versions to latest tags 2026-02-26 05:34:23 +00:00
go.sum chore: bump forge.lthn.ai dep versions to latest tags 2026-02-26 05:34:23 +00:00
helpers.go feat: extract Embedder and VectorStore interfaces, add mock-based tests 2026-02-20 00:15:54 +00:00
helpers_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
ingest.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
ingest_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
integration_test.go test: add Phase 3 integration tests with live Qdrant + Ollama (69.0% -> 89.2%) 2026-02-20 00:33:03 +00:00
keyword.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
keyword_test.go feat: Phase 3 enhancements — sentence splitting, collection helpers, keyword filter, benchmarks 2026-02-20 08:02:00 +00:00
mock_test.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
ollama.go feat: extract go-rag from go-ai as standalone RAG package 2026-02-19 18:29:59 +00:00
ollama_integration_test.go test: add Phase 3 integration tests with live Qdrant + Ollama (69.0% -> 89.2%) 2026-02-20 00:33:03 +00:00
ollama_test.go test: add Phase 1 pure-function unit tests (18.4% -> 38.8% coverage) 2026-02-20 00:02:52 +00:00
qdrant.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
qdrant_integration_test.go test: add Phase 3 integration tests with live Qdrant + Ollama (69.0% -> 89.2%) 2026-02-20 00:33:03 +00:00
qdrant_test.go test: add Phase 1 pure-function unit tests (18.4% -> 38.8% coverage) 2026-02-20 00:02:52 +00:00
query.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:36:39 +00:00
query_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
README.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
Taskfile.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
vectorstore.go feat: Phase 3 enhancements — sentence splitting, collection helpers, keyword filter, benchmarks 2026-02-20 08:02:00 +00:00

Go Reference License: EUPL-1.2 Go Version

go-rag

Retrieval-Augmented Generation library for Go. Provides document chunking with three-level Markdown splitting and configurable overlap, embedding generation via Ollama, vector storage and cosine-similarity search via Qdrant (gRPC), keyword boosting post-filter, and result formatting in plain text, XML (for LLM prompt injection), or JSON. Designed around Embedder and VectorStore interfaces that decouple business logic from service implementations and enable mock-based testing.

Module: forge.lthn.ai/core/go-rag Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "forge.lthn.ai/core/go-rag"

// Ingest a directory of Markdown files
err := rag.IngestDirectory(ctx, "/path/to/docs", "my-collection", false)

// Query for relevant context (suitable for LLM prompt injection)
context, err := rag.QueryDocsContext(ctx, "how does rate limiting work?", "my-collection", 5)

// Interface-accepting variants for long-lived processes
results, err := rag.QueryWith(ctx, store, embedder, "question", "collection", 5)

Documentation

  • Architecture — interfaces, chunking strategy, ingestion pipeline, query pipeline, keyword boosting
  • Development Guide — prerequisites, build, test tags, live vs mock tests
  • Project History — completed phases and known limitations

Build & Test

go test ./...                        # unit + mock tests (no external services)
go test -tags rag ./...              # full suite with live Qdrant + Ollama
go test -race ./...
go build ./...

Licence

European Union Public Licence 1.2 — see LICENCE for details.