How 7beshoyarnest/querymind works
QueryMind is a Gradio chatbot backed by a LangGraph agent that answers questions through SQL agents, document retrieval, and web search. The main workflow is user input → chatbot backend → agent graph, which either responds with an LLM or dispatches a tool and feeds its result back to the LLM. The README also documents vector-database preparation and configurable data sources. Edges reflect shown calls and documented setup; some implementation details, particularly travel SQL and vector preparation, were not excerpted.
Main entry points: build_full_graph.py Agent graph builder · agent_backend.py Tool dispatch and routing · chatbot_backend.py Chatbot backend · load_tools_config.py Tool configuration loader
Components 23
Chat interface
- Gradio chat UI
src/app.py - Chatbot backend
src/chatbot/chatbot_backend.py - Chat history
src/chatbot/memory.py
Agent runtime
- Agent graph builder
src/agent_graph/build_full_graph.py - Tool dispatch and routing
src/agent_graph/agent_backend.py - Primary LLM
Query tools
- Chinook SQL agent
src/agent_graph/tool_chinook_sqlagent.py - Travel SQL agent
src/agent_graph/tool_travel_sqlagent.py - Policy document retrieval
src/agent_graph/tool_lookup_policy_rag.py - Stories retrieval
src/agent_graph/tool_stories_rag.py - Web search tool
src/agent_graph/tool_tavily_search.py
Data and configuration
- Tool configuration loader
src/agent_graph/load_tools_config.py - Project configuration loader
src/chatbot/load_config.py - Tool settings
configs/tools_config.yml - Project settings
configs/project_config.yml - Chinook database
data/Chinook.db - Travel database
data/travel.sqlite - Policy vector store
data/airline_policy_vectordb - Stories vector store
data/stories_vectordb - Vector database preparation
src/prepare_vector_db.py
Other components
- User
- Groq model service
- Tavily search service
Connections 31
- User → Gradio chat UI: enters query
src/app.py - Gradio chat UI → Chatbot backend: submits query
src/app.py - Chatbot backend → Agent graph builder: streams query
src/chatbot/chatbot_backend.py - Chatbot backend → Chat history: writes history
src/chatbot/chatbot_backend.py - Agent graph builder → Tool dispatch and routing: uses routing
src/agent_graph/build_full_graph.py - Agent graph builder → Primary LLM: binds tools
src/agent_graph/build_full_graph.py - Primary LLM → Groq model service: calls model
- Agent graph builder → Chinook SQL agent: registers tool
src/agent_graph/build_full_graph.py - Agent graph builder → Travel SQL agent: registers tool
src/agent_graph/build_full_graph.py - Agent graph builder → Policy document retrieval: registers tool
src/agent_graph/build_full_graph.py - Agent graph builder → Stories retrieval: registers tool
src/agent_graph/build_full_graph.py - Agent graph builder → Web search tool: creates and registers
src/agent_graph/build_full_graph.py - Tool dispatch and routing → Chinook SQL agent: dispatches tools
- Tool dispatch and routing → Travel SQL agent: dispatches tools
- Tool dispatch and routing → Policy document retrieval: dispatches tools
- Tool dispatch and routing → Stories retrieval: dispatches tools
- Tool dispatch and routing → Web search tool: dispatches tools
- Web search tool → Tavily search service: searches web
src/agent_graph/tool_tavily_search.py - Chinook SQL agent → Chinook database: queries database
src/agent_graph/tool_chinook_sqlagent.py - Travel SQL agent → Travel database: queries database
- Policy document retrieval → Policy vector store: retrieves documents
src/agent_graph/tool_lookup_policy_rag.py - Stories retrieval → Stories vector store: retrieves stories
src/agent_graph/tool_stories_rag.py - Tool configuration loader → Tool settings: loads settings
src/agent_graph/load_tools_config.py - Project configuration loader → Project settings: loads settings
- Chinook SQL agent → Tool configuration loader: reads settings
src/agent_graph/tool_chinook_sqlagent.py - Policy document retrieval → Tool configuration loader: reads settings
src/agent_graph/tool_lookup_policy_rag.py - Stories retrieval → Tool configuration loader: reads settings
src/agent_graph/tool_stories_rag.py - Chatbot backend → Tool configuration loader: loads tool settings
src/chatbot/chatbot_backend.py - Chatbot backend → Project configuration loader: loads project settings
src/chatbot/chatbot_backend.py - Vector database preparation → Policy vector store: prepares vector stores
README.md - Vector database preparation → Stories vector store: prepares vector stores
README.md