How phatphudo/cs547-final-project works
BayRent Chat is a prototype rental-listing search app. In the main workflow, a renter submits a query in the Streamlit UI; the assistant extracts recognized constraints, searches listings, and formats cited results, with optional OpenAI phrasing. A separate MCP server exposes search and listing-detail tools. The store initializes SQLite from the JSON corpus and builds a local TF-IDF index. Source excerpts support these core calls; the README documents MCP capabilities and optional integrations, whose runtime details are not fully shown.
Main entry points: store.py Listing Search · assistant.py Query Assistant · mcp_server.py MCP Server · app.py Chat UI
Components 15
User Interfaces
- Chat UI
app.py - MCP Server
bayrent/mcp_server.py
Search Workflow
- Query Assistant
bayrent/assistant.py - Constraint Parsing
bayrent/assistant.py - Listing Search
bayrent/store.py - Keyword Ranking
bayrent/store.py - TF-IDF Ranking
bayrent/store.py
Corpus and Storage
- Listing Corpus
data/listings.json - Corpus Loader
bayrent/data.py - SQLite Listings
bayrent/store.py - Local Vector Index
bayrent/store.py
Answer Generation
- Cited Answer
bayrent/assistant.py
External Integrations
- OpenAI Responses API
Other components
- Renter
- MCP Client
Connections 16
- Renter → Chat UI: submits query
app.py - Chat UI → Query Assistant: requests answer
app.py - Query Assistant → Constraint Parsing: parses query
bayrent/assistant.py - Query Assistant → Listing Search: searches listings
bayrent/assistant.py - Listing Search → SQLite Listings: filters candidates
bayrent/store.py - Listing Search → Keyword Ranking: ranks keywords
bayrent/store.py - Listing Search → TF-IDF Ranking: ranks vectors
bayrent/store.py - Listing Search → Local Vector Index: reads index
bayrent/store.py - Corpus Loader → Listing Corpus: loads records
bayrent/data.py - SQLite Listings → Corpus Loader: seeds from
bayrent/store.py - SQLite Listings → Local Vector Index: builds index
bayrent/store.py - Query Assistant → Cited Answer: formats results
bayrent/assistant.py - Query Assistant → OpenAI Responses API: phrases optionally
bayrent/assistant.py - MCP Client → MCP Server: invokes tools
README.md - MCP Server → Listing Search: searches listings
bayrent/mcp_server.py - MCP Server → SQLite Listings: fetches detail
bayrent/mcp_server.py