Skip to content

quanticedu/re-lax-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RE/LAX Agent (LangGraph + MCP)

This starter shows a single-agent ReAct loop using LangGraph that calls tools from an MCP server. It’s designed to be runnable with free-tier access via OpenRouter (or OpenAI if you already have credits).

What it does (real estate scenario)

  • Takes a user request like: “Find 2-bedroom rentals in Venice under $4,000 and compare HOA fees.”
  • Uses MCP tools to: (1) search a toy listings.json (local) and (2) do a lightweight web search.
  • Plans → acts (tool calls) → reasons → returns a concise answer with sources and a plan summary.
  • Includes guardrails hooks (approval) and memory notes (simple in-graph state).

Quick start

  1. Create a virtual environment and install:
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt
  1. Set your API (choose one):

OpenRouter (recommended free-tier path)

export OPENAI_API_KEY="YOUR_OPENROUTER_KEY"
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export MODEL_ID="meta-llama/llama-3.1-8b-instruct:free"

OpenAI (if you already have credits)

export OPENAI_API_KEY="YOUR_OPENAI_KEY"
# No base URL needed for OpenAI; set:
export MODEL_ID="gpt-4o-mini"

(You can also copy .env.example to .env and edit values.)

  1. Start the MCP server (stdio transport):
python mcp_server_re_lax.py

Leave it running in a terminal.

  1. In another terminal, run the agent:
python agent_langgraph.py "Find 2-bed rentals in Venice under $4,000, compare HOA fees and walkability."

Notes

  • The web search tool uses duckduckgo-search (free; internet required).
  • You can extend mcp_server_re_lax.py to call real RE APIs (Zillow, Redfin, etc.) later.
  • This is a teaching starter: compact, readable, and aligned with the lesson slides.

About

Code for a single-agent system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages