Skip to main content

AI Property Assistant API

Per-listing chat with two specialized agents and server-side memory.


Start Conversation

GET /api/v1/crs/listings/assistant/{listingId}/start

Response:

{
"listingId": "lst_abc",
"message": "Hey! I'm loaded up on Nimishka Villa. Ask me anything — from objection handling to pricing rationale.",
"suggestions": [
"Why is it priced at \u20b916,400?",
"How should I pitch this to a family?",
"What objections might a client raise?",
"How does this compare to similar villas?",
"What cancellation options are available?",
"What bank offers apply here?"
]
}

Chat

Send a message. Memory is server-side — just reuse the same conversationId.

POST /api/v1/crs/listings/assistant/{listingId}/chat

First message:

{
"conversationId": "conv_abc123",
"message": "How should I pitch this to a family?"
}

Response:

{
"listingId": "lst_abc",
"message": "Start with the private pool and game room \u2014 families love that combo.\n\n\ud83d\udfe2 Perfect for groups of 4-6, sleeps up to 6\n\ud83d\udfe2 15% cheaper than similar villas in the area\n\ud83d\udfe1 Bring up free cancellation early\n\ud83d\udd34 Don\u2019t mention the 200m rough road upfront",
"agent": "LISTING"
}

Follow-up (same conversationId — assistant remembers context):

{
"conversationId": "conv_abc123",
"message": "What if they say it's too expensive?"
}

Response:

{
"listingId": "lst_abc",
"message": "Great question. Here\u2019s how to handle it:\n\n1. Compare: \u20b916,400/night for a 6-guest villa with private pool is 15% below market\n2. Break it down: that\u2019s \u20b92,733 per person per night\n3. Highlight inclusions: pool, game room, garden \u2014 no resort fees\n4. Offer the Visa 10% discount if they have a Visa card",
"agent": "PRICING"
}
Agent Routing

The agent field shows which agent handled the question:

  • LISTING — property info, amenities, pitch advice
  • PRICING — price breakdown, offers, value justification

The router picks based on keywords (price, cost, discount, cancellation → PRICING).


Clear Conversation

DELETE /api/v1/crs/listings/assistant/conversations/{conversationId}

Memory is stored in PostgreSQL (SPRING_AI_CHAT_MEMORY table). Clearing removes all messages for that conversation ID.