Skip to content

kashyapsanchit/NLQ2Mongo

Repository files navigation

NLQ2Mongo

  • This project leverages Meta's llama-3.1-8b to generate mongodb queries based on natural language inputs provided by user. It does this using langgraph and an Agentic workflow by detecting contexts and also stores the generated queries in the database for future usage.

Libraries and Frameworks


Prerequisites

  1. Python 3.9+
  2. MongoDB Instance Use MongoDB Compass to access your instance.
  3. API Keys for LLM services (e.g., OpenAI, Hugging Face).
  4. Guardrails for validations.

Setup

  1. Clone the repository:
git clone https://github.com/walkingtree/xops-nlp-search.git
cd xops-nlp-search
  1. Create and activate the environment:
python3 -m venv env
source env/bin/activate # For Linux
./env/Scripts/activate # For Windows
  1. Install all required dependencies:
pip install -r requirements.txt
  1. Setup Guardrails:

    • Get your API Key here: Guardrails-AI
    • Run the below in the terminal:
        guardrails configure
    • Set remote inferencing to Yes and diagnostics to No
  2. Create .env

  • Use the .env.example to create your own .env file
  • Add all the keys needed in .env
  1. Run the Project
python run.py

About

Retrieves and displays data from MongoDB using natural language queries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •