Multi-Agent System for Dynamic Query Resolution Using GPT-4o, MySQL, and RAG

I’m building a multi-agent system in Chainlit that utilizes GPT-4o to dynamically decide if a user’s query should be answered using a MySQL database or a datasource of PDFs. The MySQL database has multiple tables, requiring the system to identify relevant data, query it efficiently, and summarize it based on the user’s intent. For the PDF datasource, I’m implementing a RAG agent that fetches the most relevant content and uses OpenAI APIs to generate a concise summary. I’m looking for guidance on designing the architecture, managing decision-making between agents, and optimizing the summarization pipeline for both data sources.