This project is an AI-powered Query Resolution Agent designed to analyze customer support requests and generate intelligent responses using Large Language Models (LLMs). The application combines structured customer/order information from PostgreSQL with contextual retrieval and agentic decision-making to resolve customer issues.
The system is containerized using Docker and consists of:
- FastAPI Backend
- Streamlit Frontend
- PostgreSQL Database
- LangGraph Agent Workflow
- LLM Integration (Google Gemini)
Provides a user interface where support agents can submit customer queries and view generated resolutions.
Acts as the orchestration layer and exposes API endpoints used by the frontend.
Responsibilities:
- Receive support requests
- Execute the LangGraph workflow
- Retrieve customer/order information
- Invoke the LLM
- Return generated responses
Stores customer, order, and product information used as structured context for resolution generation.
The agent follows a multi-step workflow:
- Receive customer query
- Fetch customer and order context from PostgreSQL
- Retrieve additional Company policy knowledge from the vector store (RAG)
- Generate reasoning and resolution using the LLM
- Return the final response to the frontend
The LangGraph workflow executes the following loop:
User Query ↓ Context Retrieval ↓ Database Lookup ↓ Knowledge Retrieval (RAG) ↓ LLM Reasoning ↓ Response Generation
The workflow combines:
- Structured customer/order information
- Retrieved knowledge documents
- LLM reasoning
to generate accurate and context-aware resolutions.
Create a .env file in the project root.
Example:
GOOGLE_API_KEY=your_api_key
DATABASE_URL=postgresql+psycopg2://username:password@postgres:5432/db_name
POSTGRES_USER=username
POSTGRES_PASSWORD=password
POSTGRES_DB=db_nameReplace the API key according to the LLM provider being used.
- Docker
- Docker Compose
docker compose up -dExpected containers:
- postgres
- worknoon_backend
- worknoon_frontend
docker compose stopdocker compose startdocker compose up --build -dproject/
│
├── backend/
│ ├── api.py
│ ├── graph.py
│ ├── db.py
│ └── db_config.py
│
├── frontend/
│ └── app.py
│
├── docker-compose.yml
├── requirements.txt
├── .env.example
└── README.md