i’ve got an agent running with a fixed list of que...
# ask-ai
m
i’ve got an agent running with a fixed list of questions it needs to ask (kind of like an interview flow). right now i just throw all the questions into the instructions, but sometimes it skips one, or rephrases in a way that means the question never really gets asked. is there a good way to keep some state so i can, track which questions have already been asked, know which ones are still pending, and make sure the missing ones eventually get asked before the session ends? wondering if i should be hooking into events and updating session state, or if there’s a built-in pattern/tool for this that i’m missing.
t
Thanks for reaching out, Ayush. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you make sure every question in your interview flow is asked and tracked smoothly. A great way to do this is by combining frontend state management with backend session control: • Frontend State Management: Keep a list of questions, track which question you're on, and save the user's answers. This way, any unanswered questions can be flagged, and you can gently prevent submission until everything is completed. • Backend Session Control: Use session state to keep an eye on progress. You can add logic to confirm that all required questions are answered before moving forward. • Communication: Utilize Remote Procedure Calls (RPC) to keep the agent and client in sync, so the flow stays consistent and smooth. This method helps ensure no question gets missed and lets you easily track how things are progressing. If you'd like, I’m happy to walk you through detailed implementation steps tailored to your needs—just let me know! Sources: evaluating-agents/agent_evals.py