Inspiration
Commercial Real Estate (CRE) leasing and acquisitions require a multi-disciplinary approach—analyzing lease financials, transit connectivity, local zoning laws, neighborhood sentiment, and competitive business density. Typically, this research requires expensive specialized data tools, manual coordinate mapping, and hours of reading dense city reports. CRE Agent v2 was built to automate this entire process into a single, cohesive, autonomous agentic workflow, giving investors and brands instant, publication-grade commercial investment briefs with a clear viability score, strategic next steps, and competitor density metrics.
What it does
CRE Agent v2 is an autonomous, multi-turn conversational agent designed to analyze commercial real estate assets globally. It handles a multi-step mission to move beyond simple chat queries:
Property Discovery: Autonomously queries commercial properties from a database based on city, type, and budget. Geospatial Transit Analysis: Runs native MongoDB $nearSphere geospatial queries on property coordinates to map transit hubs and calculate proximity ratings. Semantic Vector Research: Runs vector searches on unstructured neighborhood market sentiment reports, development plans, and yields. Synthesizing & Reporting: Compiles financial, geospatial, and semantic data into a publication-grade Markdown investment brief with dynamic currency & area localizations. Interactive Steering & Competitive Analysis: Presents the user with three interactive strategic steps—including running business/brand competitor density lookups (e.g. jewelry or apparel stores) within a radius, simulating higher budget thresholds, or drafting custom lease negotiation emails. Filing Records: Autonomously writes the final compiled investment briefs directly to the system's local database records folder.
How we built it
The Agent & Planning Loop: Built with the Google GenAI SDK and Gemini 3.5 Flash as the reasoning core. The agent uses a strict system prompt instructing it to run planning, sequential tool execution (Retrieval $\rightarrow$ Geospatial $\rightarrow$ Semantic $\rightarrow$ Generation), and interactive option steering. Model Context Protocol (MCP) Server: Built a FastMCP python server in
mcp_server.py exposing six powerful tools to Gemini:
search_properties (MongoDB-backed queries)
geospatial_near_search (MongoDB $nearSphere queries)
semantic_sentiment_research (hybrid local/cloud vector search)
generate_investment_brief (publication brief compiler)
run_competitive_analysis (brand competitor density mapping)
save_brief_to_records (local filesystem output) Dual-Path Vector Search Fallback: To make vector search compatible with local MongoDB Community Edition without requiring cloud Atlas vector indices, we built a hybrid local fallback: retrieving raw embeddings and running high-dimensional cosine similarity ranking directly in Python. Global Localization Engine: Leverages Gemini web search grounding to dynamically resolve real-time real estate parameters (currency, symbol, area unit, local yields, and USD exchange rates) for any city globally (e.g. Paris, Singapore, London, or Gwalior).
Challenges we ran into
Seamless Multi-Step Tool Chain Orchestration: Getting the agent to correctly execute multiple tools in sequence without returning premature answers. We solved this by designing a rigid execution protocol in the agent instructions, forcing a strict loop through search, geospatial proximity, and semantic vector matching before compiling the report. Local Developer Environment Vector Limits: Bypassing local MongoDB vector search limitations by building the Python cosine similarity fallback, enabling local testing to behave identically to production. Dynamic Localization across Global Currencies: Normalizing rent rates (e.g. sqft vs sqm, INR vs USD/EUR/SGD) across different international markets was resolved by building a dynamic grounding localizer. Very high Gemini api cost usage
Accomplishments that we're proud of
Interactive Multi-Turn Steering: Transitioning from a static QA bot to an active strategic advisory partner that prompts the user with next steps (Option A/B/C) and updates files/reports dynamically based on selections. Geospatial & Vector Fusion: Combining exact coordinate-based proximity math with semantic neighborhood sentiment search inside the agent's context. Local File Writing Action: Allowing the agent to directly file generated Markdown reports (e.g.
gwalior_premium_commercial_hub_brief_8207.md ) to the local workspace records folder.
What we learned
MCP Simplifies Agent Toolkits: FastMCP drastically reduces the friction of connecting complex databases and calculations to Gemini, allowing us to treat MongoDB queries as native agent actions. Aesthetics and Trust Go Hand-in-Hand: For platforms dealing with high-value investments, visual excellence and clean presentation matter. Hybrid Systems are the Future of Agentic Workflows: Standard chatbots fail when tasked with structured validation. Keeping data retrieval and scoring deterministic while using LLMs for synthesis represents a highly robust architecture.
What's next for Untitled (CRE Agent v2)
Dynamic Competitor Brand Mapping APIs: Connecting to Google Places or Yelp API to fetch live store locations rather than seeded/mock datasets. Multi-Agent Collaboration: Introducing a "Negotiation Agent" and "Legal Risk Agent" that review the lease briefs before the user signs them. Interactive PDF Generation: Enabling the agent to directly compile and format the Markdown records into print-ready PDF briefs.
Built With
- 3.5
- agent
- api
- builder
- cloud
- fastmcp
- flash
- gemini
- mongodb
- nextjs
- nominatim
- openstreet
- typescript
Log in or sign up for Devpost to join the conversation.