An interactive apartment search assistant powered by LangChain Deep Agents and Tavily web search. Uses Anthropic's Claude Sonnet 4.6 for LLM inference.
- Conversational intake — Asks clarifying questions about budget, neighborhood, commute, pets, amenities, and more before searching
- Structured research — Searches StreetEasy, Apartments.com, Zillow, and other sources using Tavily
- NYC expertise — Built-in knowledge of boroughs, neighborhoods, transit lines, and rental market norms
- LangSmith tracing — Full observability of agent planning, tool calls, and responses
- Session management — Maintains conversation context; type
newto start a fresh search
- Python 3.11+
- An Anthropic API key
- A Tavily API key (free tier works)
- A LangSmith API key (free tier works)
pip install -e .Or with uv:
uv syncEdit the .env file with your actual keys:
ANTHROPIC_API_KEY=sk-ant-your-actual-key
TAVILY_API_KEY=tvly-your-actual-key
LANGSMITH_API_KEY=lsv2-your-actual-key
LANGSMITH_TRACING=true
LANGSMITH_PROJECT=apt-searchpython agent.pyThe agent follows a structured workflow:
- Intake — Asks you about budget, preferred neighborhoods, commute, apartment size, pets, amenities, deal-breakers, and more
- Confirmation — Summarizes your criteria and asks you to confirm
- Research — Searches multiple sources for matching listings and neighborhood data
- Report — Presents organized findings with recommendations
- Iteration — Refines the search based on your feedback
| Command | Action |
|---|---|
new |
Start a new search session |
quit / exit |
End the program |
apt-search/
├── .env # API keys
├── pyproject.toml # Dependencies
├── agent.py # Main interactive agent
├── README.md
└── skills/
├── apartment-search-intake/
│ └── SKILL.md # Intake & clarifying questions
├── apartment-research/
│ └── SKILL.md # Search strategy & reporting
└── nyc-neighborhoods/
└── SKILL.md # NYC neighborhood knowledge
Guides the agent to collect comprehensive search criteria before doing any research. Covers: budget, location, commute, apartment size, move-in timeline, pets, amenities, deal-breakers, lease preferences, and financial readiness.
Provides the structured research workflow: search strategy across multiple platforms, evaluation criteria, comparison framework, and report format.
NYC-specific knowledge base covering all five boroughs, subway lines, commute estimates, pricing tiers, and essential rental market facts (broker fees, income requirements, rent stabilization, etc.).
Tracing is enabled by default via the .env file. View your traces at smith.langchain.com under the apt-search project to see:
- Agent planning and task decomposition
- Tavily search queries and results
- Skill activation and usage
- Full conversation history