LangChain: Postgres AI is an intelligent assistant that allows users to interact with a PostgreSQL database using natural language queries. It leverages the power of LangChain agents and the Groq API for seamless integration with database operations.
- Natural Language Querying: Translate user queries into SQL and fetch results dynamically.
- Streamlit Interface: An intuitive web-based UI for interaction.
- Dynamic Database Integration: Configure and connect to any PostgreSQL database.
- Error Handling: Robust error detection and informative feedback.
- Agent-Based Execution: Leverages LangChain Zero-Shot React agents for database queries.
git clone https://github.com/your-username/langchain-postgres-ai.git
cd langchain-postgres-aipython3 -m venv venv
source venv/bin/activatepip install -r requirements.txt[postgresql]
host=<YOUR_DB_HOST>
database=<YOUR_DB_NAME>
user=<YOUR_DB_USER>
password=<YOUR_DB_PASSWORD>
port=<YOUR_DB_PORT>streamlit run app.pyInput your Groq API key in the sidebar under Groq API Key.def connect():
connection = psycopg2.connect(**config())
return connection
"how many cehicles in fleet A.""The system translates the query into SQL and fetches results from the connected database.""This project is licensed under the MIT License. See the LICENSE file for more details
."
