Retrieval-Augmented Generation with Qdrant and Ollama
  • Go 96.1%
  • Python 3.9%
Find a file
Snider 755ad5f68d
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
chore(repo): cleanup tracked-artifacts + replace-directives (audit dims)
Removes: -5 replace-directives. Updates .gitignore with canonical artifact pattern set.

Audit dims `tracked-artifacts` + `replace-directives` (core/go commits
62aac07 + b48b896). Same root-cause class as Mantis #1333 / structural
no-replace policy. Applying ecosystem-wide.

Co-Authored-By: Cladius Maximus <cladius@lethean.io>
2026-05-01 10:39:46 +01:00
.core chore: add .core/ build and release configs 2026-03-06 18:52:37 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:08 +00:00
.github/workflows ci(public): add github actions workflow + README badge block 2026-04-30 15:24:50 +01:00
docs fix(rag): address CodeRabbit findings on PR #4 2026-04-27 14:47:38 +01:00
external chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade unblock) 2026-05-01 09:40:56 +01:00
go chore(repo): cleanup tracked-artifacts + replace-directives (audit dims) 2026-05-01 10:39:46 +01:00
specs fix(rag): r2 — AX-2 docstrings + remaining residual findings on PR #4 2026-04-27 17:19:22 +01:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
.gitignore chore: add .core/ and .idea/ to .gitignore 2026-03-15 10:17:50 +00:00
.gitmodules chore(go-rag): restructure Go module under go/ + go.work + external/ submodules 2026-04-30 12:29:34 +01:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
.woodpecker.yml chore(go-rag): restructure Go module under go/ + go.work + external/ submodules 2026-04-30 12:29:34 +01:00
AGENTS.md refactor(core): align go-rag with v0.9.1 hardened core/go reference shape 2026-04-29 04:22:50 +01:00
CLAUDE.md chore(go-rag): restructure Go module under go/ + go.work + external/ submodules 2026-04-30 12:29:34 +01:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:44 +00:00
go.work chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade unblock) 2026-05-01 09:40:56 +01:00
go.work.sum chore(repo): refresh submodules + go.work hygiene (Phase 2 cascade unblock) 2026-05-01 09:40:56 +01:00
LICENCE chore: add EUPL-1.2 LICENCE file (UK English canonical) 2026-05-01 08:34:49 +01:00
README.md ci(public): add github actions workflow + README badge block 2026-04-30 15:24:50 +01:00
sonar-project.properties chore(go-rag): restructure Go module under go/ + go.work + external/ submodules 2026-04-30 12:29:34 +01:00

Retrieval-augmented generation — chunking, embeddings, qdrant + ollama

CI Quality Gate Coverage Security Rating Maintainability Rating Reliability Rating Code Smells Lines of Code Go Reference License: EUPL-1.2

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

The package also exposes convenience helpers such as QueryWith, QueryContextWith, IngestDirWith, IngestFileWith, QueryDocs, QueryDocsContext, IngestDirectory, IngestSingleFile, CollectionStats, ListCollectionsSeq, FileExtensions, ShouldProcess, JoinResults, KeywordFilterSeq, ChunkBySentences, and ChunkByParagraphs for common one-shot and prompt-assembly flows.

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

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

Licence

European Union Public Licence 1.2 — see LICENCE for details.