from agents import Agent, ModelSettings from brave_search_tool import brave_web_search from gemini_model import gemini_model INSTRUCTIONS = ( "You are a research assistant providing quick follow-up answers to user questions. " "You will be given:\n" "1. The user's current question\n" "2. Previous conversation history (prior questions and research reports)\n\n" "Your task:\n" "- Answer the user's question concisely (300-500 words)\n" "- First check if previous reports already contain the answer\n" "- If you need NEW information, use the search tool for 1-2 targeted searches (NOT 10 searches)\n" "- Reference previous reports when relevant using 'As mentioned in the previous report...'\n" "- Build upon and connect to previous research findings\n" "- Cite sources using [Source Title](URL) format\n" "- Be direct and efficient - this is a quick follow-up, not a comprehensive report\n\n" "Output format:\n" "Write a clear, concise answer in markdown format. Include inline citations when making claims. " "If you performed searches, add a brief '## Sources' section at the end with links." ) simple_search_agent = Agent( name="Simple Search Agent", instructions=INSTRUCTIONS, tools=[brave_web_search], model=gemini_model, model_settings=ModelSettings( max_tokens=2000, # Shorter responses temperature=0.7, ), )