Skip to content

A repository for Multi-Meta-RAG: Improving RAG for Multi-Hop Queries using Database Filtering with LLM-Extracted Metadata

License

Notifications You must be signed in to change notification settings

mxpoliakov/Multi-Meta-RAG

Repository files navigation

Multi-Meta-RAG

Prerequisites

# Clone with MultiHop-RAG submodule
git clone --recurse-submodules https://github.com/mxpoliakov/Multi-Meta-RAG.git
# Install requirements (includes forked langchain with nin operator fix)
pip install -r MultiHop-RAG/requirement.txt
pip install -r requirements.txt
# Export env variables as needed
export NEO4J_PASSWORD=
export NEO4J_URI=
export NEO4J_USERNAME=
export VOYAGE_API_KEY=
export OPENAI_API_KEY=
export GOOGLE_CLOUD_PROJECT_ID=
export GOOGLE_CLOUD_LOCATION=

Query metadata filter retrieve

# Will create query_metadata_filters.json
python query_metadata_filters_retrieve.py

Create and retrieve relevant evidence from vector index

python create_neo4j_index.py
python retrieve_neo4j_index.py

Run QA

python qa_google.py
python qa_gpt.py

Evaluation

# Evaluate retrieval experiment using MultiHop-RAG evaluation script
cd MultiHop-RAG
python retrieval_evaluate.py --path ../output
# Evaluate generation accuracy
python evaluate_qa.py

About

A repository for Multi-Meta-RAG: Improving RAG for Multi-Hop Queries using Database Filtering with LLM-Extracted Metadata

Resources

License

Stars

Watchers

Forks

Languages