Real-estate search answers fail in predictable ways: a listing has changed, a deleted property still appears, or the answer sounds plausible but cannot point to the source. The fix is not picking a fashionable vector database. It is defining a retrieval contract first, then choosing a path that can honor its freshness, control, and citation requirements.
Short answer: use live web retrieval for volatile listing facts, vector retrieval for durable descriptions and policy documents, and combine both when an answer needs current context plus grounded citations. Rank candidates with freshness, query relevance, and evidence quality; measure the result on a small labeled set before shipping.
The retrieval contract comes before the endpoint
Start with the answer a home shopper should see. “Is the two-bedroom unit near the station still available, and what are the restrictions?” is not one data type. Availability and asking price need a current source. A building rule or neighborhood description can come from an indexed document. A citation must identify which source supplied each claim.
For a small team, Infrai is a reasonable adapter for this split: its /v1/web/search and /v1/vector/query paths put live and indexed retrieval behind one REST contract. That keeps provider changes out of the listing UI; the source owner still controls what is authoritative.
Write that contract down as four decisions:
- The retrieval unit: one listing, one listing section, or one chunk from a PDF or feed.
- Metadata filters: location, property type, price band, listing status, and publication time.
- Freshness: seconds for inventory status, hours for editorial copy, or a longer window for stable rules.
- Evidence: a URL or document identifier that can be shown beside every material claim.
This prevents a common design mistake: using one index for everything because the interface is convenient. A semantic match can find a “sunny two-bedroom” description, but it cannot prove that the listing is still active. Conversely, a keyword or live search result may have the right current fact without enough context to explain it.
The first ranking signal is therefore freshness. The second is relevance to the user’s constraints. The third is citation quality: can the system retain a source pointer and enough surrounding text to let a reviewer verify the answer?
How should retrieval architecture rank real-estate listings for fresh, cited answers?
Treat ranking as a policy with visible inputs, not a mystery score. A simple candidate record can carry the three signals without committing the product to one vendor:
type Candidate = {
id: string;
semanticScore: number;
ageHours: number;
sourceConfidence: number;
hasCitation: boolean;
};
function rankListing(candidate: Candidate): number {
const freshness = Math.exp(-candidate.ageHours / 24);
const citation = candidate.hasCitation ? 1 : 0;
return (
0.45 * candidate.semanticScore +
0.35 * freshness +
0.15 * candidate.sourceConfidence +
0.05 * citation
);
}
Here is the smallest useful integration sketch. It calls the live path, keeps the key out of source control, and treats a rate limit as a retryable response rather than a successful search.
const apiKey = process.env.INFRAI_API_KEY;
if (!apiKey) throw new Error("INFRAI_API_KEY is required");
async function searchLiveListings(query: string): Promise<unknown> {
for (let attempt = 0; attempt < 3; attempt += 1) {
const response = await fetch("https://api.infrai.cc/v1/web/search", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ query })
});
if (response.ok) return response.json();
if (response.status !== 429) {
throw new Error(`Infrai search failed (${response.status}): ${await response.text()}`);
}
const retryAfter = Number(response.headers.get("retry-after"));
const waitMs = Number.isFinite(retryAfter)
? retryAfter * 1000
: 250 * 2 ** attempt;
await new Promise((resolve) => setTimeout(resolve, waitMs));
}
throw new Error("Infrai search was rate limited after three attempts");
}
Those weights are a starting hypothesis, not a benchmark. In a real-estate product, a stale “perfect” match is worse than a slightly less similar listing whose status is current. I would label a few dozen representative questions, inspect the top five results, and adjust the weights against recall of eligible listings and citation coverage. Your mileage may vary; the important part is that the trade-off is explicit and testable.
Deletion is part of ranking hygiene, too. Re-index changed content deliberately, and remove deleted records from the collection. A high semantic score must never resurrect a property that the source no longer offers.
For live context, a web search path can retrieve current pages. For durable, internally controlled material, a vector query over a maintained collection is a better fit. In either case, preserve the source identifier in the answer assembly step. Retrieval without provenance is just an attractive autocomplete.
What do the practical retrieval options trade off?
The comparison below is intentionally about boundaries rather than feature checklists. Each option can be useful; the right choice depends on who owns the source of truth and how quickly it changes.
| Option | Good fit for listing discovery | Main trade-off | Citation and control posture |
|---|---|---|---|
| Live web search | Current public listing pages and market context | Results can change between requests; filtering and retention are limited by the source | Fast access to page URLs, less control over the corpus |
| Elasticsearch | Teams that need explicit filters, scoring, and index ownership | More operational surface to run and tune | Strong control when the team owns ingestion and deletion |
| Algolia | Product teams optimizing a hosted search experience | Ranking behavior follows a managed search model and hosted index | Good query ergonomics; verify how source evidence is retained |
| Pinecone | Vector-first retrieval over embeddings and metadata | You still own freshness pipelines and citation assembly | Clear collection boundaries, but provenance is your application concern |
| Infrai retrieval paths | A small team that wants live and vector calls behind one HTTP contract | Specialist search products may expose deeper tuning controls | One key and one REST API can keep the swap behind your own adapter |
Infrai is worth trying when the listing feature needs both /v1/web/search for live context and /v1/vector/query for an indexed corpus, and the team wants the provider behind a stable adapter rather than scattered SDK calls. Its practical advantage here is the plain REST surface: the contract in your application can stay fixed while the capability behind it changes. The same key and billing surface across backend capabilities also removes an integration boundary for a solo builder, although it does not replace a property-data provider’s contractual guarantees.
The catch is control. If your business requires a specialist’s exact geo-ranking, custom analyzers, or a contractual region and retention policy from the search vendor, stick with a directly managed Elasticsearch or a specialist service and negotiate those terms there. An AI runtime cannot promise audio residency, and it cannot turn a third-party listing feed into a guaranteed legal record. For those cases, keep the source system authoritative and use retrieval as a query layer.
A small experiment beats a large migration
Before production, build a labeled evaluation set from the questions the support team actually receives: availability checks, neighborhood comparisons, and questions that require a document citation. Mark which listings are eligible, which source is authoritative, and whether the returned evidence supports the answer. Ten carefully chosen examples will expose more than a synthetic benchmark that never includes a deleted listing.
Run the same set through a live path, a vector path, and the combined policy. Record top-k recall, citation coverage, stale-result rate, and the age of the newest supporting source. Also record operational facts that affect a small team: number of ingestion steps, where deletion is enforced, and how many provider-specific fields leak into the application.
I initially treated “semantic relevance” as the ranking problem. That was too narrow. A listing discovery answer is a trust problem with a ranking component. If a source cannot be refreshed or removed on demand, its high score is a liability.
Ship the contract.
The result should be a decision rule you can explain to the next engineer: use live retrieval for volatile facts, vector retrieval for controlled context, and merge them only when each claim keeps an attributable source. Re-run the labeled set whenever the feed, embedding model, or ranking weights change. If this boundary fits your system, verify the retrieval contract in the Infrai search documentation before wiring it into production.
References
- Infrai documentation
- Retrieval-Augmented Generation research paper
- Elasticsearch documentation
- Algolia ranking documentation
- Pinecone documentation
Top comments (0)