A multi-agent real estate AI assistant built using LangChain, LangGraph, LangSmith for observability, and LangMem for persistence. Powered by OpenAI's GPT-5, the system includes a Property Finder agent that parses natural language requests and queries a Supabase backend via RPC, and Calendar Manager agent responsible for scheduling viewings. Search results are displayed using Generative UI in a clean, in-chat interface built with React and Tailwind CSS.
- π Natural Language Property Search: Ask for properties in plain English
- π Smart Calendar Management: Schedule property viewings with intelligent calendar coordination
- π¨ Modern React UI: Beautiful property carousels with responsive design
- π€ Clean LangGraph Architecture: Supervisor pattern with specialized sub-agents
- πΎ Long-Term Memory: Remembers user preferences and information across conversation threads
- ποΈ Supabase Integration: Real-time property data from PostgreSQL database
- π§ͺ Comprehensive Testing: 86 tests (70 unit + 16 integration) with full LangGraph tool coverage
Before running this project, make sure you have:
- Python 3.10+ installed
- Node.js 18+ and npm installed
- OpenAI API Key (Get one here)
- Supabase Project (Create one here)
- LangSmith Account (Optional, for tracing - Sign up here)
-
Clone the repository:
git clone https://github.com/yourusername/multi-agent-ai-realtor.git cd multi-agent-ai-realtor -
Install Python dependencies with uv (no pip):
# One-time (install uv) curl -LsSf https://astral.sh/uv/install.sh | sh # Install the project and dependencies (creates .venv automatically) uv sync
-
Install frontend dependencies:
cd src/frontend npm install -
Build the frontend CSS:
npm run dev
-
Configure Environment Variables
Copy .env.example to .env and fill in your actual API keys:
cp .env.example .envRequired variables:
OPENAI_API_KEY: Your OpenAI API keySUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase anon keyLANGSMITH_API_KEY: Your LangSmith API key (optional, for tracing)
-
Run the application:
# From the project root directory uv run langgraph dev -
Access the UI: Open Agent Chat in your browser to interact with the AI agents and see the rendered property carousel UI.
Note: The property carousel and other UI components will only render in Agent Chat, not in the LangGraph Studio interface.
Try these natural language queries in the chat interface:
- "Show me 2-bedroom apartments in New Cairo under 5M EGP"
- "Find villas with swimming pools in 6th of October City"
- "I need a 3-bedroom apartment with parking in Maadi"
- "Show me properties under 3 million EGP with gardens"
multi-agent-ai-realtor/
βββ src/
β βββ agents/ # LangGraph agent implementations
β β βββ supervisor/ # Supervisor agent and state management
β β βββ property_finder/ # Property search specialist
β β βββ calendar_manager/ # Calendar and scheduling specialist
β βββ frontend/ # React UI components (Tailwind CSS)
β βββ utils/ # Shared utilities (Supabase, Google Calendar)
β βββ graph.py # Main application entry point
βββ tests/ # Comprehensive unit test suite
β βββ conftest.py # Global test configuration
β βββ unit/ # Unit tests for LangGraph tools
βββ langgraph.json # LangGraph configuration
βββ pyproject.toml # Python dependencies
βββ .env # Environment variables
The application follows a clean supervisor-agent pattern with modular, specialized components:
- Supervisor Agent (
src/agents/supervisor/): Orchestrates conversation flow, manages user memory, and coordinates UI rendering - Property Finder (
src/agents/property_finder/): Specialized agent for natural language property search and filtering - Calendar Manager (
src/agents/calendar_manager/): Handles scheduling, availability checking, and appointment booking - React UI Components (
src/frontend/): Modern, responsive property carousel with Tailwind CSS - Database Integration (
src/utils/): Supabase PostgreSQL with property data and RPC functions
- ποΈ Modular Architecture: Each agent is self-contained with its own tools and responsibilities
- π― Separation of Concerns: Agents focus on domain expertise, supervisor handles orchestration
- π¨ Centralized UI: All UI rendering happens at supervisor level using
render_property_carousel - β‘ Stateless Tools: Tools use Command pattern for clean, predictable state updates
- π Type Safety: Full TypeScript/Python type annotations throughout the codebase
- π¦ Clean Imports: Proper module organization with clear dependency paths
- User Input β Supervisor analyzes intent and delegates to appropriate agent
- Property Search β Property Finder parses query and searches database
- UI Rendering β Supervisor uses
render_property_carouselto display results - Appointment Booking β Calendar Manager handles scheduling when requested
The project includes comprehensive testing for all LangGraph tools with 86 tests total - ALL PASSING β :
- β parse_property_search_query (12 tests): Natural language parsing with LLM mocking
- β search_properties (16 tests): Database queries with Supabase RPC mocking
- β find_available_slots (14 tests): Google Calendar API integration with timezone handling
- β schedule_viewing (14 tests): Event creation with input validation and error handling
- β render_property_carousel (14 tests): UI rendering with state injection testing
- β Property Search Flow (5 tests): End-to-end query parsing β property search workflow
- β Calendar Flow (5 tests): Complete slot finding β viewing scheduling workflow
- β Render Carousel (6 tests): Property carousel rendering with realistic application state
- LangChain Standard Tests: Schema validation, tool initialization, and metadata verification
- Custom Unit Tests: Business logic, error handling, API integration, and edge cases
- Integration Tests: End-to-end workflows testing realistic tool interactions
- Global Mocking: Supabase client, Google Calendar API, and LLM calls properly mocked
- Direct Function Testing: Innovative approach for testing tools with
InjectedStateparameters
# Run all tests (unit + integration)
uv run pytest tests/ -v
# Run only unit tests
uv run pytest tests/unit/ -v
# Run only integration tests
uv run pytest tests/integration/ -v
# Run tests for a specific tool
uv run pytest tests/unit/test_search_properties.py -v
# Run tests with coverage report
uv run pytest tests/unit/ --cov=src --cov-report=term-missingtests/
βββ conftest.py # Global test configuration and mocking
βββ unit/ # Unit tests for individual tools
βββ integration/ # Integration tests for end-to-end workflows
- Fork the repository
- Create a feature branch
- Make your changes
- Add/update tests for any new functionality
- Run the test suite:
pytest tests/ -v(both unit and integration tests) - Ensure all tests pass
- Submit a pull request
- All new LangGraph tools must include comprehensive unit tests
- Add integration tests for new workflows or tool interactions
- Follow the established testing patterns (LangChain Standard Tests + Custom Tests)
- Mock external dependencies (Supabase, Google Calendar, LLM calls)
- Test error handling, edge cases, and input validation
- Maintain the current test coverage standards (86+ tests)
π For detailed testing documentation, examples, and guidelines, see tests/README.md
MIT

