Loading repository data…
Loading repository data…
jonathanfavorite / repository
A lightweight, cross-platform .NET library for building RAG (Retrieval-Augmented Generation) pipelines with local embedding models and SQLite vector storage. Perfect for developers who need privacy-focused, offline-capable document search and AI-powered question answering without external API dependencies.

A lightweight, cross-platform .NET library for building RAG (Retrieval-Augmented Generation) pipelines with local embedding models and SQLite vector storage.
dotnet add package RAGamuffin
using RAGamuffin.Builders;
using RAGamuffin.Core;
using RAGamuffin.Embedding;
using RAGamuffin.Enums;
// 1. Set up your embedding model (download from HuggingFace)
var embedder = new OnnxEmbedder("path/to/model.onnx", "path/to/tokenizer.json");
// 2. Configure your vector database
var vectorDb = new SqliteDatabaseModel("documents.db", "my_collection");
// 3. Build and train your pipeline
var pipeline = new IngestionTrainingBuilder()
.WithEmbeddingModel(embedder)
.WithVectorDatabase(vectorDb)
.WithTrainingStrategy(TrainingStrategy.RetrainFromScratch)
.WithTrainingFiles(new[] { "document.pdf" })
.Build();
var ingestedItems = await pipeline.Train();
// 4. Search your documents
string[] results = await pipeline.SearchAndReturnTexts("What is the company policy?", 5);
// Stream text content directly into your vector store
var textItems = new[]
{
new TextItem("Meeting notes from Q1", "Q1 was successful with 15% growth..."),
new TextItem("Product roadmap", "Next quarter we'll launch feature X...")
};
var (ingestedItems, model) = await pipeline.TrainWithText(textItems);
// Search without retraining
var vectorStore = new SqliteVectorStoreProvider("documents.db", "my_collection");
var searchResults = await vectorStore.SearchAsync("your query", embedder, 5);
// Get metadata
var metadata = await vectorStore.GetAllDocumentsMetadataAsync();
Check out the comprehensive examples in the Examples/ directory:
RAGamuffin supports ONNX models for cross-platform compatibility. Recommended starter model:
// PDF processing options
.WithPdfOptions(new PdfHybridParagraphIngestionOptions
{
MinSize = 0, // Minimum chunk size
MaxSize = 800, // Maximum chunk size
Overlap = 400, // Overlap between chunks
UseMetadata = true // Include document metadata
})
// Text processing options
.WithTextOptions(new TextHybridParagraphIngestionOptions
{
MinSize = 500, // Minimum chunk size
MaxSize = 800, // Maximum chunk size
Overlap = 400, // Overlap between chunks
UseMetadata = true // Include document metadata
})
RAGamuffin is built with a modular architecture:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE.txt file for details.
RAGamuffin - Making RAG pipelines simple and accessible for .NET developers.