A company is building an agent that uses Azure OpenAI Service to answer customer queries by querying a SQL database. The agent must be able to handle complex multi-turn conversations and maintain context. Which approach should the team use to implement the agent?
Trap 1: Use a single prompt that includes the entire conversation history…
Conversation history grows quickly and may exceed token limits.
Trap 2: Use a chain-of-thought prompt to generate SQL queries directly from…
Without memory, the agent cannot handle multi-turn conversations.
Trap 3: Use embeddings-based retrieval to find relevant past interactions…
Retrieval is useful for knowledge but not for structured query generation with context.
- A
Use a single prompt that includes the entire conversation history and the latest user question, then generate SQL.
Why wrong: Conversation history grows quickly and may exceed token limits.
- B
Use a chain-of-thought prompt to generate SQL queries directly from user input, without maintaining conversation history.
Why wrong: Without memory, the agent cannot handle multi-turn conversations.
- C
Use embeddings-based retrieval to find relevant past interactions and include them in the prompt.
Why wrong: Retrieval is useful for knowledge but not for structured query generation with context.
- D
Use a conversational agent framework like AutoGen with a tool that executes SQL queries, and maintain conversation state.
AutoGen provides multi-turn conversation management and tool integration.