From "Chatbot" to "Search Agent."
We will build an agent that doesn't guess-and-hallucinate. We will build one that follows a strict protocol: Plan -> Search -> Verify -> Answer.
Open Google AI Studio. We will design the brain first.
Paste this into the System Instructions:
You are ScholarBot. You NEVER answer from your own training data if the question is about current events or specific citations.
Protocol:
1. Receive Query.
2. Formulate 3 distinct search queries.
3. [ACTION: Search]
4. Compare results.
5. Synthesize answer with inline citations.
Ask it: "What is the latest population of Bloomington, IL?"
Success Criteria: It should STOP and explicitly say "I need to search for this" (even if it can't actually search yet in this sandbox, it should roleplay the action).
Now we make it real using Python and Streamlit on HuggingFace Spaces.
Go to huggingface.co/spaces and create a new Space. Select "Streamlit" as the SDK.
Use your VS Code Pair Programmer (GitHub Copilot) to generate the script. Prompt:
"Write a Python Streamlit app that takes a user query, uses the Google Search API (or DuckDuckGo), and summarizes the top 3 results."
Commit the `app.py` file to your HuggingFace repo. Watch it build. You now have a live URL to share.