This is a submission for the Built with Google Gemini: Writing Challenge
I built FinAgent.NET, an autonomous financial research agent. The goal was simple yet ambitious: create a tool that doesn't just "chat," but thinks, plans, and learns while investigating market data.
The Problem: Financial research is often fragmented. Analysts jump between news terminals, stock price APIs, and SEC filings. It’s manual, slow, and prone to oversight.
The Solution: FinAgent.NET acts as a digital quantitative analyst. You give it a complex prompt "Analyze the impact of interest rate changes on tech stocks over the last quarter" and it handles the rest.
AI's Role: Using the Microsoft Agent Framework and Google Gemini via Microsoft.Extensions.AI, the AI operates in a Self-Correction Loop. It creates a plan, executes tool calls to fetch real-time market data, and then reflects on its own findings. If the data is incomplete, it goes back into the loop until the research is solid.
🔍 What I Built: The "Claude Code" of Finance
I built FinAgent.NET, an autonomous financial research agent. The goal was simple yet ambitious: create a tool that doesn't just "chat," but thinks, plans, and learns while investigating market data.
The Problem: Financial research is often fragmented. Analysts jump between news terminals, stock price APIs, and SEC filings. It’s manual, slow, and prone to oversight.
The Solution: FinAgent.NET acts as a digital quantitative analyst. You give it a complex prompt—"Analyze the impact of interest rate changes on tech stocks over the last quarter"—and it handles the rest.
AI's Role: Using the Microsoft Agent Framework and Google Gemini via Microsoft.Extensions.AI, the AI operates in a Self-Correction Loop. It creates a plan, executes tool calls to fetch real-time market data, and then reflects on its own findings. If the data is incomplete, it goes back into the loop until the research is solid.
🧠 What I Learned: Beyond the Code
Building this project wasn't just about syntax; it was about architectural philosophy.
Agnosticism is Power: By using Microsoft.Extensions.AI, I learned how to build a system that is model-agnostic. Switching from a cloud-based LLM to a local model via Ollama became a configuration change rather than a code rewrite.
The "Single Agent" Realization: One of the biggest technical pivots was moving away from a complex multi-agent system (three separate agents talking) to a Single Agent State Machine. I realized that for a research loop, keeping the context in a single, well-managed ChatHistory is significantly cleaner and more reliable.
Soft Skills in "AI Negotiation": I learned how to treat the AI as a collaborator. Correcting the AI's initial over-engineered design for the agent loop taught me that a builder's intuition is still the ultimate compass.
💬 Google Gemini Feedback: The Good, The Bad, and The Ugly
The Good
Contextual Speed: Gemini was incredibly fast at parsing the GitHub repositories for examples and translating those Python concepts into a .NET-friendly architecture.
Structure: The ability to generate complex, ready-to-use plan.md files for other AI dev tools (like Cursor or Cline) acted as a massive force multiplier.
The Bad
Framework Friction: Occasionally, the AI leaned toward older Semantic Kernel patterns when I explicitly asked for the newer Microsoft Agent Framework. It required a few "pokes" to stay updated with the latest documentation.
The Ugly
Architectural Hallucinations: In the beginning, Gemini pushed for a "Group Chat" multi-agent design because that's a common framework trope. It took a firm human intervention to realize that for this specific use case, a single-loop design was superior. It’s a reminder that AI is a co-pilot, not the captain.
🚀 Where I’m Headed Next
The foundation of FinAgent.NET is solid. My next steps involve:
Real-time Streaming: Implementing SignalR to stream the agent's "thoughts" to a dashboard in real-time.
Persistent Memory: Giving the agent a vector database so it "remembers" previous market analyses to improve its future planning.
FinAgent.NET is proof that with the right tools and a bit of grit, we can build C# systems that don't just process data—they understand it.
Top comments (0)