Skip to main content

MetaRAG: A multi-LLM ensemble Retrieval-Augmented Generation framework with cosine similarity ranking.

Project description

MetaRAG is a Python framework for multi-model Retrieval-Augmented Generation. It queries multiple LLMs in parallel, scores the responses based on cosine similarity with the context, and aggregates the top responses for a more accurate and comprehensive answer.

Features

  • 🔍 Multi-LLM querying using Groq's LLMs (LLaMA3, Gemma, etc.)
  • 🤝 Cosine similarity scoring of responses
  • 🧠 Top-k response aggregation
  • 📄 Works with PDFs and plain text
  • ⚡ Fast execution with thread pooling

Installation

pip install metarag

Pre-requisites

Load your GROQ_API_KEY to the project from https://console.groq.com/keys and follow the sample example shown below.

Example Usage

import metarag
from dotenv import load_dotenv
load_dotenv()  
def test_metarag_functionality():
    
    document_paths = ["VectorDB_Paper.pdf"]  

    rag_instance = metarag.MetaRAG(document_paths=document_paths)

    query = "What is the methodology in 5 lines like a professor and extract 5 keywords?"

    result = rag_instance.run(query)

    print(f"Aggregated Response: {result}")

if __name__ == "__main__":
    test_metarag_functionality()

Requirements

Python 3.8+

License

MIT License - see LICENSE file for details.

Author

Nisharg Nargund
Founder @OpenRAG

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metarag-0.1.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metarag-0.1.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file metarag-0.1.4.tar.gz.

File metadata

  • Download URL: metarag-0.1.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.7

File hashes

Hashes for metarag-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6d6543b33318739c8188c7a2f20bcc6654d880556b0c5d7c5f3d926c0000f22d
MD5 a98db3f3631148eef8bb272475ae9409
BLAKE2b-256 d2cdc254e4ed3527dadce8b36a7e9604a08265e4e887c60386617a5c2f469eef

See more details on using hashes here.

File details

Details for the file metarag-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: metarag-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.7

File hashes

Hashes for metarag-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 170c17488d036fda7113677bd408f40b96905ee268e583fe10fc1e4f7f3d2296
MD5 9ef25a8471db0448e2ddac45b3ff729d
BLAKE2b-256 a369c5c35903ac146ca66fd44c37ed5a64540abe5c2508ca76c506f0c263f825

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page