An offline-capable AI agent that leverages DeepSeek and Llama2 models through Ollama for natural language processing and intelligent inventory management, with MongoDB integration for data persistence.
This project demonstrates an intelligent system that can:
- Process natural language queries offline using local LLM models
- Manage inventory data through MongoDB
- Handle complex business logic without internet connectivity
- Maintain conversation context and chat history
- Generate dynamic database queries from natural language input
- Ollama Integration: Local model management and inference
- DeepSeek Model: Primary language model for query processing
- MongoDB Backend: Persistent data storage and retrieval
- Query Processing: Natural language to database query conversion
- Session Management: Maintains context across conversations
Muhammad Aqeel Yasin
Shadow Analytics
- Natural language query processing using Deepseek and Llama2 models
- MongoDB integration for data persistence
- Intelligent query parsing and response generation
- Real-time inventory tracking
- Supplier management
- Chat history tracking
- Session-based interactions
- Python 3.8+
- MongoDB
- Ollama
- Clone the repository
git clone [repository-url]
- Install required packages
pip install -r requirements.txt
-
Install and start MongoDB
-
Install Ollama and pull required models
ollama pull deepseek-r1:14b
- Start the application:
python main.py
- Enter natural language queries, for example:
- "What is the current stock level of laptops?"
- "Who is the supplier for item ID 1?"
- "Update stock level for laptops"
main.py
- Application entry pointquery_agent.py
- Main query processing agentdatabase_setup.py
- MongoDB database initialization and operationsollama_helper.py
- LLM integration helperprompt_manager.py
- Manages system promptsquery_generator.py
- Generates database queries from natural language
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.