Perplexity for Housing

GitHub

Team

Inspiration & Project Purpose

As a study abroad student in Edinburgh, I witnessed firsthand the severe housing crisis affecting international students across the UK. I saw countless peers struggling to find safe, affordable accommodation—spending weeks in temporary housing, falling victim to scams, or settling for substandard living conditions far from campus. This housing instability directly impacted their academic performance, mental health, and overall study abroad experience.

The problem was clear: students needed a comprehensive, intelligent solution that could cut through the noise of scattered listings, verify information, and provide personalized recommendations. Traditional housing search methods were time-consuming, unreliable, and often led to dead ends.

OwlBot was born from this need—a housing copilot that acts as your personal assistant throughout the entire housing search journey.

The platform combines three powerful capabilities:

  1. Deep Research: Leveraging Perplexity's Sonar models, OwlBot performs comprehensive web searches across multiple sources, gathering real-time property listings, rental market insights, and legal information specific to your location and needs.

  2. Vector Similarity Search: Our AI-powered matching system uses semantic understanding to analyze your preferences and match you with the most relevant properties and roommates from our curated database. It goes beyond simple keyword matching to understand context and intent.

  3. Recurring Search Agents: Set up automated agents that continuously monitor the housing market based on your criteria. These agents run daily, weekly, or monthly searches, alerting you to new opportunities so you never miss the perfect listing—even while you're focused on your studies.

OwlBot doesn't just find housing; it provides peace of mind, saves countless hours of manual searching, and empowers students to make informed decisions with confidence. It's the assistant every international student deserves when navigating unfamiliar housing markets.

Technical Approach & Perplexity's API

Core Architecture & User Journey:

  1. Query Analysis: If user's prompt is not housing related, we reply asking for a housing query. User's housing query is broken down into categories: houses, roommates, and laws using OpenAI Chat Completions API.

  2. Database Search: First, the database is searched for constant lookup time on each category. All houses and roommates are retrieved from MongoDB and analyzed using AI matching to find the most relevant results.

  3. Deep Research: If no relevant queries are found in the database or to supplement results, deep research is performed using Perplexity's Sonar models for the relevant fields.

  4. Chain of Thought Visualization: As Deep Research is being performed, relevant CoT (Chain of Thought) steps are displayed to the user with visual status indicators and real-time progress updates.

  5. Results Display: Once all results are received, they are saved to the database and displayed in a structured format with property cards, roommate profiles, and legal information.

  6. Agent Creation: If a user likes a query or wants recurring searches, they can set it as a repeating agent that searches the same query every 24 hours.

Perplexity API Integration:

Impact & Capabilities: The system combines local database intelligence with real-time web research, providing users with both curated matches from our database and fresh listings from across the web. The Chain of Thought visualization keeps users engaged and informed about the search process, while the agent system enables automated, recurring searches for ongoing housing needs.

Tech Stack & Setup Instructions

Frontend:

  • Next.js 15.5.2 with TypeScript
  • Tailwind CSS for styling
  • React components with custom UI library
  • Server-Sent Events (SSE) for real-time updates
  • Lucide React icons and React Icons

Backend:

  • Node.js with Express and TypeScript
  • MongoDB with Mongoose ODM
  • OpenAI GPT-3.5 Turbo for query analysis and AI matching
  • Perplexity AI Sonar models for deep research
  • JWT authentication
  • Server-Sent Events for streaming responses

Setup Instructions:

  1. Clone the repository

    git clone <repository-url>
    cd perplexity-for-housing
    
  2. Backend Setup

    cd backend
    npm install
    cp .env.example .env
    # Configure environment variables in .env
    npm run dev
    
  3. Frontend Setup

    cd frontend
    npm install
    cp .env.local.example .env.local
    # Configure environment variables in .env.local
    npm run dev
    
  4. Environment Variables

    • OPENAI_API_KEY: Your OpenAI API key
    • PERPLEXITY_API_KEY: Your Perplexity AI API key
    • MONGODB_URI: MongoDB connection string
    • JWT_SECRET: Secret for JWT token signing
    • NEXT_PUBLIC_API_URL: Backend API URL for frontend
  5. Database Setup

    • Ensure MongoDB is running
    • The application will create necessary collections automatically

Development Commands:

  • npm run dev: Start development server
  • npm run build: Build for production
  • npm run start: Start production server
  • npm run lint: Run linting checks

Built With

Share this project:

Updates