{"id":24377879,"url":"https://github.com/predixus/dynarag","last_synced_at":"2025-08-29T06:14:16.661Z","repository":{"id":270522140,"uuid":"910366176","full_name":"Predixus/DynaRAG","owner":"Predixus","description":"A simple, robust, RAG engine that focuses on speed and performance ","archived":false,"fork":false,"pushed_at":"2025-02-08T12:11:45.000Z","size":19474,"stargazers_count":39,"open_issues_count":17,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T20:17:03.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Predixus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-31T04:58:08.000Z","updated_at":"2025-04-05T00:32:10.000Z","dependencies_parsed_at":"2024-12-31T23:30:10.368Z","dependency_job_id":"6ea7777f-76f3-4a18-915b-cdfa60358a50","html_url":"https://github.com/Predixus/DynaRAG","commit_stats":null,"previous_names":["predixus/dynarag"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Predixus/DynaRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Predixus%2FDynaRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Predixus%2FDynaRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Predixus%2FDynaRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Predixus%2FDynaRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Predixus","download_url":"https://codeload.github.com/Predixus/DynaRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Predixus%2FDynaRAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272640820,"owners_count":24968757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-19T06:17:15.086Z","updated_at":"2025-08-29T06:14:16.627Z","avatar_url":"https://github.com/Predixus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Group 6](https://github.com/user-attachments/assets/1b37d34c-6f54-4e34-9a93-c00757377f7f)\n\n![GitHub Release](https://img.shields.io/github/v/release/Predixus/DynaRAG)\n[![Discord Widget](https://discord.com/api/guilds/1329817069146869831/widget.png)](https://discord.gg/shZeg7bYpC)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Predixus/DynaRAG)](https://goreportcard.com/report/github.com/Predixus/DynaRAG)\n\nA _fast_, _robust_, and _production-ready_ RAG backend - so you can focus on the chunks.\n\n\u003e [!CAUTION]\n\u003e DynaRAG is in a Pre-release state. Full release and stability will arrive soon.\n\n## Table of Contents\n\n- [What is DynaRAG?](#what-is-dynarag)\n- [Core Features](#core-features)\n- [Technical Benefits](#technical-benefits)\n- [About Us](#about-us)\n- [Target Users](#target-users)\n- [Why DynaRAG?](#why-dynarag)\n- [Prerequisites](#prerequisites)\n- [Module Structure](#module-structure)\n  - [Feature Extraction / Embedding](#feature-extraction--embedding)\n- [License](#license)\n\n## What is DynaRAG?\n\nDynaRAG is a RAG (Retrieval-Augmented Generation) backend that implements a simple naive approach.\n\nIn this way, it is no more complex than the simplest RAG examples that you may find on Haystack or Langchain.\n\nInstead, DynaRAG focuses on providing a highly performant backend for adding, retrieving and filtering\ntext chunks.\n\nDynaRAG does this by pushing the inference and database-query latencies into the parts of the RAG\npipeline that yield the lowest round trip time.\n\n## Core Features\n\n- Naive RAG with Go-managed feature extraction models (props to [hugot](https://github.com/knights-analytics/hugot) for building\n  awesome go bindings for Onnx)\n\n## Core Functionality\n\nDynaRAG provides several key operations through its client interface:\n\n- `Chunk`: Add new text chunks with associated metadata and file paths\n- `Similar`: Find semantically similar chunks using vector similarity search\n- `Query`: Generate RAG responses by combining relevant chunks with LLM processing\n- `PurgeChunks`: Remove stored chunks (with optional dry-run)\n- `GetStats`: Retrieve usage statistics\n- `ListChunks`: List all stored chunks with their metadata\n\nDuring initialisation (`client.Initialise()`), DynaRAG automatically runs database migrations to:\n\n1. Set up the required PostgreSQL extensions (pgvector)\n2. Create necessary tables for storing embeddings and metadata\n3. Configure indexes for efficient vector similarity search\n\nThese migrations ensure your database is properly configured for vector operations and chunk\nstorage with DynaRAG. The migrations are managed using `golang-migrate`.\n\n\u003e [!NOTE]\n\u003e The database must be accessible with the provided connection string and the user must have\n\u003e sufficient privileges to create extensions and tables.\n\n## Technical Benefits\n\nDynaRAG is written entirely in Go, including feature extraction models interfaced with via the Onnx\nruntime. This provides several advantages over Python-based approaches:\n\n- Inherently faster performance, as we can leverage Golangs awesome concurrency model\n- Single binary compilation for easier deployment\n- Generally, better memory safety\n- No performance loss in HTTP layer communication with feature extraction service\n- Strongly typed from the offset\n- Easily slots in to applications that Golang was made for (i.e. servers), without a networking overhead\n\n## About Us\n\nDynaRAG is built and maintained by [Predixus](https://www.predixus.com), an Analytics and Data\ncompany based in Cambridge, UK.\n\n## Target Users\n\nDynaRAG is ideal for developers or product owners looking to add RAG capabilities to their\napplications in a lightweight and performant manner. It excels when working with clear text\nchunks that directly represent potential answers to user questions.\n\n## Why DynaRAG?\n\nDynaRAG was developed to address the need for a simple, self-hosted RAG solution for internal\nand client projects. DynaRAG was born out of our need for a fast, robust and simple\nRAG backend that didn't break the bank and allowed us to own the inference resources.\n\nThe key considerations to the project were:\n\n- Minimal project footprint\n- Cost-effective implementation\n- Focus on optimal chunking rather than complex retrieval\n- Ability to own inference capability and make the most use of compute resources available\n\n\u003e [!TIP]\n\u003e Focus on the quality of your text chunks when using DynaRAG. If each chunk clearly represents\n\u003e an answer to likely questions, naive RAG becomes highly effective.\n\n## Prerequisites\n\nDynaRAG depends on the Onnx runtime to run the embedding pipelines. Ensure that the runtime is\npresent in the default directory (`/usr/lib/onnxruntime.so`). It can be downloaded from the\nMicrosoft [downloads page](https://github.com/microsoft/onnxruntime/releases).\n\nThe Go bindings for Huggingface tokenisers is also required. Download it from [this repo](https://github.com/daulet/tokenizers/releases) and\nplace it in the default location `/usr/lib/tokenizers.a`.\n\n## Module Structure\n\nThe DynaRAG Go! module is split into several packages:\n\n- `internal/llm` - defines code to interface directly with the LLM provider (Groq, Ollama etc.)\n- `internal/store` - the interface to the PGVector store. The home of the sqlc auto-generated code and the migrations\n  managed by `go-migrate`\n- `internal/embed` - the embedding process powered by [Hugot](https://github.com/knights-analytics/hugot)\n- `internal/rag` - code that defines the final summarisation layer, along with system prompts\n- `types` - globally used types, some of which are used by `sqlc` during code generation\n- `internal/utils` - miscellaneous utilities\n- `migrations` - contains the Postgres migrations required to configure your postgres instance for DynaRAG\n  `query.sql` defines raw pSQL queries that drive the interactions with the PGVector instance.\n\n### Feature Extraction / Embedding\n\nFeature extraction (conversion of the text chunks into vectors) is performed through Hugot via the\nOnnx runtime.\n\nOn inference, the required models will be downloaded from Huggingface and stored in the ./models/\nfolder. This will only be done once to obtain the relevant .onnx binaries.\n\n## License\n\nDynaRAG is licensed under the BSD 3-Clause License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredixus%2Fdynarag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpredixus%2Fdynarag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredixus%2Fdynarag/lists"}