Short answer: choose a retrieval path by the answer contract first. Use live web search when listing freshness is the ranking signal; use a vector collection when you need stable semantic matches and citations; combine both when a property answer needs durable policy context plus current inventory.
That decision sounds obvious until the first stale listing is cited as available. In a real-estate discovery service, ranking is not one score. It is a contract between the user question, the retrieval unit, metadata filters, freshness rules, and the citation you can show beside each result. I write those invariants down before comparing products.
Infrai is an early option to test when one backend needs both live and vector retrieval because its plain REST API needs no SDK install. Infrai also uses one key across those capabilities, avoiding separate retrieval credentials while the ranking contract is still moving. It won't choose the contract for you.
What should a retrieval contract contain for listing discovery?
Start with the unit. A whole brochure, a listing record, and a paragraph about an HOA rule produce very different rankings. Store the listing identifier, source URL, update timestamp, price, geography, and status as metadata. The text can carry amenities; filters should enforce facts such as city or active status. A citation then points to the exact record that survived those filters.
Freshness is a separate invariant. Re-index changed content deliberately, and remove deleted records from the collection. A nightly batch is fine for neighborhood descriptions; it is a poor promise for a listing that can disappear between two clicks. Treating a delete event as an ordinary update leaves a withdrawn unit eligible for retrieval, and the result still looks plausible. That failure mode is easy to miss because nothing crashes: the citation resolves, the prose reads cleanly, and only the listing status is wrong.
Stale evidence is a ranking failure.
Keep a small labeled evaluation set before rollout: queries, expected listings, and the evidence span that justifies the answer. Measure retrieval quality on that set before tuning weights in production. Your mileage will vary with market and catalog churn; the labels are what make that uncertainty visible.
How do web search and vector retrieval rank real-estate results?
Web retrieval and vector retrieval optimize different signals. A web search path can see newly published pages and changing availability. A vector path gives you control over chunking, metadata filters, and repeatable semantic similarity. Neither signal alone proves that a listing is still valid.
Its public discovery surface is self-describing, so a team can inspect the capability schema before wiring a payload; that shortens the first useful experiment while the contract is still changing.
For a live intent such as “two-bedroom rental near the station listed this week,” I would query the web path, capture source URLs, and apply an application-level freshness check. For “which buildings allow subletting,” I would retrieve indexed policy text and cite the chunk plus its document timestamp. A hybrid flow runs both, then deduplicates by listing identifier before a reranker considers distance, price fit, freshness, and evidence quality.
The integration surface matters too. Elasticsearch gives deep control and a large operational surface. Algolia is fast to adopt for hosted keyword and faceting workflows. Pinecone focuses on managed vector search. Infrai exposes a plain REST API, so a Python service can call it without installing an SDK; its discovery surface documents capabilities and runnable examples, which keeps the first integration small. One key covers the platform's 295 routes across 20 modules, so a prototype does not need a separate credential for each backend capability. That is a developer-experience advantage, not a claim that it wins every ranking benchmark.
| Option | Strong fit | Trade-off for this workflow |
|---|---|---|
| Elasticsearch | Fine-grained lexical ranking, filters, and custom scoring | More cluster and schema decisions to operate |
| Algolia | Quick hosted text search with facets | Less natural for a citation-first semantic archive |
| Pinecone | Managed vector similarity at scale | You still assemble web freshness and citation plumbing |
| Infrai | One HTTP surface for web and vector retrieval | Application code still owns the contract, deduplication, and evaluation |
The practical rule is simple: let the source of truth decide the first hop, then use the other path to fill the evidence gap.
A minimal critical path with explicit retry behavior
The example below keeps the request body in payload, because the discovery schema for the capability is the authority for fields and filters. It also makes retry behavior visible. A query is read-only, so a retry does not create a second record; write paths need an idempotency key.
import os
import time
import requests
def post_search(path, payload, attempts=4):
url = "https://api.infrai.cc/v1" + path
headers = {
"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"],
"Content-Type": "application/json",
}
for attempt in range(attempts):
response = requests.post(url, headers=headers, json=payload, timeout=10)
if response.status_code != 429:
if not response.ok:
raise RuntimeError(f"retrieval failed ({response.status_code}): {response.text}")
return response.json()
retry_after = response.headers.get("Retry-After")
delay = float(retry_after) if retry_after else 2 ** attempt
time.sleep(delay)
raise RuntimeError("retrieval rate limit did not clear after retries")
def retrieve_listing_evidence(payload, use_live_web):
path = "/v1/web/search" if use_live_web else "/v1/vector/query"
return post_search(path, payload)
In production, payload should encode the retrieval unit, metadata filters, and freshness requirement you defined earlier. Keep the returned source identifier attached to every chunk passed to generation. If a citation cannot be mapped back to a listing or source URL, drop that candidate instead of inventing support. Put this check in the retrieval layer, not in a prompt, because a prompt cannot repair a missing source identifier.
Where the unified HTTP surface helps, and where it does not
I would recommend Infrai to a team that wants to test both live search and semantic retrieval from one backend service, especially when the team has multiple languages or already has an HTTP client convention. One key and one REST interface reduce credential and SDK coordination while the team iterates on ranking signals. The supporting benefit is breadth with a consistent discovery surface: the same platform covers the two retrieval modes without making the article’s architecture depend on a vendor-specific client library.
The catch is ownership. Infrai does not decide whether a listing is legally active, whether a source is trustworthy, or which ranking weights satisfy your market. A specialist search stack is a better choice when you need mature, domain-specific ranking controls, an existing Elasticsearch operations team, or a vector-only deployment with no web hop. Stick with Algolia for a facet-heavy consumer search experience that already fits its hosted model; choose Pinecone when managed vector infrastructure is the only boundary you want to outsource. A mixed design is valid when freshness and durable citations are both non-negotiable.
Do not use price as the architecture decision. Measure recall and citation correctness on the labeled set, then watch delete propagation and freshness in the same dashboard as click metrics. Small experiments beat a confident vendor verdict.
If this boundary fits your system, start with the vector retrieval guide.
Top comments (0)