How eugene234466/ai-real-estate-lead-assistant works
AI Real Estate Lead Assistant provides a prospect web-chat workflow backed by a Flask API: the chat endpoint stores messages, invokes structured AI response generation, updates lead qualification, and can trigger a human-handoff notification. Agents can take over or resume AI; separate backend capabilities cover appointments, scheduled follow-ups, authentication, and CRM pages. The graph combines excerpted calls and SOURCE INDEX references with README-documented capabilities; unsampled page, event, SSE, and domain implementations are represented without inferred call chains.
Main entry points: conversations/routes.py Chat endpoint · appointments/routes.py Appointment API · tasks.py Follow-up tasks · service.py AI response service
Components 25
Web experience
- Chat widget
frontend/src/components/chat/ChatWidget.tsx - Message display
frontend/src/components/chat/MessageBubble.tsx - API client
frontend/src/api/client.ts - CRM pages
frontend/src/pages
Identity and catalog
- Authentication API
backend/app/modules/auth/routes.py - Users
backend/app/modules/auth/models.py - Organizations
backend/app/modules/organizations/models.py - Properties
backend/app/modules/properties/models.py
Conversation and AI
- Chat endpoint
backend/app/modules/conversations/routes.py - Conversations and messages
backend/app/modules/conversations/models.py - AI response service
backend/app/modules/ai_engine/service.py - Groq model client
backend/app/modules/ai_engine/groq_client.py - Output validation
backend/app/modules/ai_engine/output_schema.py
Lead lifecycle
- Lead records
backend/app/modules/leads/models.py - Lead state machine
backend/app/modules/leads/state_machine.py - Follow-up tasks
backend/app/modules/followups/tasks.py - Follow-up records
backend/app/modules/followups/models.py - Appointment API
backend/app/modules/appointments/routes.py - Appointments
backend/app/modules/appointments/models.py - Notifications
backend/app/modules/notifications/models.py - Event logging
backend/app/modules/events
Other components
- Prospect
- Real estate agent
- Database extensions
backend/app/extensions.py - Tenant model base
backend/app/shared/db_base.py
Connections 30
- Prospect → Chat widget: sends inquiry
README.md - Chat widget → Message display: renders messages
frontend/src/components/chat/ChatWidget.tsx - Chat widget → API client: sends text
frontend/src/components/chat/ChatWidget.tsx - API client → Chat endpoint: posts message
frontend/src/api/client.ts - Real estate agent → CRM pages: uses CRM
README.md - CRM pages → Chat endpoint: views conversations
- Authentication API → Users: creates and checks
backend/app/modules/auth/routes.py - Authentication API → Organizations: creates organization
backend/app/modules/auth/routes.py - Chat endpoint → Conversations and messages: stores messages
backend/app/modules/conversations/routes.py - Chat endpoint → Organizations: selects organization
backend/app/modules/conversations/routes.py - Chat endpoint → AI response service: requests response
backend/app/modules/conversations/routes.py - AI response service → Properties: loads verified listings
backend/app/modules/ai_engine/service.py - AI response service → Groq model client: requests completion
backend/app/modules/ai_engine/service.py - AI response service → Output validation: validates output
backend/app/modules/ai_engine/service.py - Chat endpoint → Lead records: creates or updates
backend/app/modules/conversations/routes.py - Chat endpoint → Lead state machine: applies stage
backend/app/modules/conversations/routes.py - Chat endpoint → Notifications: records handoff
backend/app/modules/conversations/routes.py - Follow-up tasks → Follow-up records: schedules and updates
backend/app/modules/followups/tasks.py - Follow-up tasks → Lead records: checks inactivity
backend/app/modules/followups/tasks.py - Follow-up tasks → Conversations and messages: adds follow-up message
backend/app/modules/followups/tasks.py - Follow-up tasks → AI response service: generates message
backend/app/modules/followups/tasks.py - Follow-up tasks → Lead state machine: moves to nurture
backend/app/modules/followups/tasks.py - Appointment API → Appointments: creates appointment
backend/app/modules/appointments/routes.py - Appointment API → Lead records: loads lead
backend/app/modules/appointments/routes.py - Appointment API → Lead state machine: books lead
backend/app/modules/appointments/routes.py - Appointment API → Notifications: records booking
backend/app/modules/appointments/routes.py - Real estate agent → Appointment API: books appointment
README.md - Chat endpoint → Event logging: logs events
README.md - Appointment API → Event logging: logs events
README.md - Database extensions → Tenant model base: backs models
backend/app/shared/db_base.py