Steering Gemini: How I Built a "Bengaluru-Native" AI Agent with Kiro

Subtitle: Moving beyond generic LLMs: A case study in Agent Steering, Context Injection, and building AI that speaks "Tanglish".


The Problem: AI Has a "Generic" Problem

We live in the age of Large Language Models (LLMs). They are brilliant, encyclopedic, and... incredibly boring.

If you ask a standard AI about traffic in Bengaluru, it gives you a Wikipedia-style answer: "Bengaluru has significant traffic congestion."

But if you ask a local, they say: "Macha, don't even think about Silk Board at 6 PM. You will age there."

For the Kiro Week 5 Challenge, I asked myself a question: Can we mathematically steer a global AI model (Google Gemini) to adopt a hyper-local, culturally rich persona without fine-tuning?

The answer is Namma Guide. And the secret weapon was Agent Steering.



🧠 The Architecture: "The Brain" in a Text File

Most developers try to fix AI behavior with complex Python scripts. I discovered a cleaner way using Kiro's Agent Steering capabilities. The entire personality of my app lives in a single, lightweight Markdown file (product.md) that acts as the "Brain" of the application.

1. The "Steering" Logic (product.md)

Instead of hard-coding rules, I created a dynamic context file that Kiro injects into the AI's system prompt. This file contains specific "Protocols":

  • 🌧️ The Rain Protocol: In Bengaluru, rain isn't just weather; it's a mobility crisis. If [Weather: Rain] is detected, the AI is forbidden from recommending auto-rickshaws. It steers the user toward Metro or staying home.
  • 🚥 The Silk Board Paradox: If the user asks about the "Silk Board" junction between 5 PM and 8 PM, the AI switches from "Helpful Assistant" mode to "Sarcastic Local" mode, offering reality checks instead of routes.
  • 🍛 The Heritage Protocol: The Agent is programmed to reject global fast-food chains. It strictly recommends heritage spots like Vidyarthi Bhavan (for Dosa) or Meghana Foods (for Biryani).

2. The Implementation (Context Injection)

Using Flutter and the google_generative_ai package, I built a pipeline that intercepts the user's voice query and wraps it in a "Context Envelope" before sending it to Gemini Flash.

Here is the Logic that Powers the Agent:

// 1. Loading the "Brain" from the Kiro-defined structure
String steeringContent = await rootBundle.loadString('assets/product.md');

// 2. The "Context Envelope" Pattern
// We inject the Steering Rules + Real-Time Telemetry + User Query
final fullPrompt = """
SYSTEM INSTRUCTION: $steeringContent

[LIVE TELEMETRY]
Time: ${DateTime.now()}
Weather: ${weatherService.current} // e.g., "Rain"
Location: Bengaluru

[USER QUERY]: $userQuery
""";

// 3. Execution
// This forces Gemini to "roleplay" the Namma Guide persona strictly.
final response = await _model.generateContent([Content.text(fullPrompt)]);

🚀 The Result: AI That Feels Alive

The difference is startling. By using Agent Steering, we moved from "Information" to "Connection."

  • Generic AI: "I recommend you eat Dosa."
  • Namma Guide: "Dosa scene ah? Go to Vidyarthi Bhavan for the vibe, Guru. But go early, queue is long!"

(Above: Left - The Logs showing the "Brain Active" steering; Right - The AI correctly identifying the rain context and using local slang like "Guru" and "Adjust Maadi".)


⚡ Why Kiro Made the Difference

The constraint of this hackathon was to use the /.kiro directory and product.md. This wasn't just a rule; it was an accelerator.


By defining the Product Context in the Kiro sidebar, the IDE itself understood what I was building. When I asked Kiro to "Write the logic for the Rain Protocol," it didn't give me generic if-else statements. It generated code that checked my specific product.md file and integrated it with the Gemini API.

This concept—Environment-Aware Coding—significantly streamlined the development process.


🏁 Conclusion

Namma Guide proves that we don't need massive compute resources to build personalized AI. We need smart Steering. By combining the raw power of Google Gemini with the precise control of Context Injection, we can build agents that don't just know about the world—they know your world.


Tags: #GenerativeAI #Flutter #AgenticAI #GoogleGemini #KiroIDE #PromptEngineering #ContextAware #LocalGuide #AppDevelopment

Comments