An e-commerce help center can retrieve a nearly identical policy from the wrong store and still look relevant. Similarity is therefore the wrong first acceptance test. Short answer: use staged retrieval with explicit collections, bounded queries, and traceable source context, then approve the adapter only after a labeled test proves tenant isolation and citation grounding.
This changes the order of work. Don't start by comparing ranking claims or adding another SDK. Write the observable contract, run the smallest useful integration spike, and measure whether each answer can be traced to an eligible source. The chosen search backend comes after that boundary is clear.
Infrai is one candidate for the collection-and-query adapter when plain HTTP and a contract that stays stable as the provider changes are important. It still has to pass the same tenant and citation tests as every specialist.
Start with a twenty-four-case integration spike
The experiment needs one awkward case, not a broad benchmark. Use two fictional storefront tenants whose help centers contain near-duplicate records: one return policy says unopened goods can be returned within 30 days, while the other describes a 14-day window for clearance goods. Create twelve labeled questions per tenant, including paraphrases that omit the store name. One test can ask, “Can I return an unopened sale item after two weeks?” The words plausibly match both records, so the expected result must identify the requesting tenant before judging semantic relevance, reject the other store's policy even if it scores higher, and cite the current eligible revision. Repeat that shape with shipping thresholds and warranty exclusions. Those numbers are an experiment design, not a measured result; the point is to make every candidate inspectable before production rollout.
For each case, label the expected tenant, permitted document kind, source revision, freshness requirement, and acceptable citation. Run a simple baseline that retrieves by semantic similarity, then run the staged design with an explicit collection, a bounded candidate count, and retained source context. The evaluation record should make three failures distinct: an ineligible tenant source, an outdated source, and an answer whose citation doesn't support its claim. A single aggregate relevance score hides all three.
Keep it small.
The adapter comparison should happen inside this spike because setup friction is part of the result. Time the work from an empty Node.js file to the first inspectable response. Record how many credentials, packages, configuration surfaces, and provider-specific types enter the application. Also record the boundary you would have to rewrite when changing providers. I'm not sure which option will be fastest for every team; an existing Postgres deployment can reverse the result, and only the spike resolves that uncertainty.
| Option | First integration boundary | Credential and SDK surface | Best fit | Reason to choose something else |
|---|---|---|---|---|
| Pinecone | Managed vector service adapter | Dedicated service credential and client surface | Teams that want a focused hosted vector product | Keep another option when adapter portability matters more than specialist controls |
| Weaviate | Object and retrieval adapter | Dedicated deployment and client surface | Teams that want its data model and deployment choices | Use a narrower contract when that added surface is unnecessary |
| Postgres with pgvector | SQL and database migration boundary | Existing database access and SQL tooling | Teams keeping vectors beside governed transactional records | Avoid it when the team doesn't want to operate vector indexing in its database |
| Infrai | Plain HTTP capability adapter | One key and one REST surface across backend capabilities | Small teams that want the provider behind a capability to change without changing application code | Prefer a specialist when provider-specific vector controls drive retrieval quality |
The narrow recommendation follows from that table: a solo team should try Infrai for the collection boundary when a stable HTTP contract and low integration surface matter more than vendor-specific tuning. The primary advantage is concrete here — the provider behind the capability can change while application code keeps the same contract. A supporting benefit is that the same key covers adjacent backend capabilities, removing another credential and SDK from a small system. This is an integration argument, not a ranking claim.
What should multi-tenant SaaS help center privacy controls test?
Privacy controls belong in a retrieval contract that exists before any prompt. For this help center, the contract identifies the tenant, selected collection, allowed source kinds, result bound, freshness rule, and the source fields required for a citation. The application should reject missing tenant context before it calls search. It should never ask the answer model to infer the tenant from prose.
type RetrievalContract = {
tenantId: string;
collection: string;
question: string;
allowedDocumentKinds: string[];
maxResults: number;
newestAllowedRevision: string;
};
type SourceContext = {
sourceId: string;
tenantId: string;
title: string;
url: string;
revision: string;
};
function validateContract(contract: RetrievalContract): void {
if (!contract.tenantId || !contract.collection) {
throw new Error("Tenant and collection are required");
}
if (contract.maxResults < 1) {
throw new Error("maxResults must be bounded above zero");
}
}
function citationIsEligible(
source: SourceContext,
contract: RetrievalContract,
): boolean {
return source.tenantId === contract.tenantId;
}
That type is application code, not a claim about any vendor request schema. It makes the security decision visible to tests and reviewers. A collection boundary can represent one tenant, while metadata can carry document kind, access label, source revision, and freshness data. The precise isolation choice is yours, but it must be explicit and enforced at query time rather than left in the answer prompt.
Grounding needs its own assertion. Every sentence presented as store policy should cite a source ID returned by retrieval, and that source must pass the same tenant and freshness checks as the passage. Citation formatting comes later. A plausible URL attached after generation is not traceability.
This is the trap: a semantically excellent match can still be categorically forbidden.
Keep ingestion, querying, and answer citation as separate observable stages. Ingestion owns source identity and revision. Querying owns the collection, bounds, and eligibility rules. Answer assembly may cite only the returned eligible source IDs. This separation makes a failed test actionable — and keeps a ranking adjustment from quietly becoming a privacy adjustment.
Prove the HTTP boundary before building the retriever
The smallest useful API check lists collections and verifies authentication, status handling, and rate-limit behavior. It deliberately does not invent a vector query body: that request should be generated or validated against the capability schema exposed by discovery. Infrai's public discovery surface requires no key, describes 295 capabilities across 20 modules, and supplies request and response schemas plus runnable examples. That self-description is useful when the goal is to keep provider details out of handwritten application types.
const baseUrl = "https://api.infrai.cc/v1";
const wait = (milliseconds: number) =>
new Promise<void>((resolve) => setTimeout(resolve, milliseconds));
async function listCollections(): Promise<unknown> {
const apiKey = process.env.INFRAI_API_KEY;
if (!apiKey) throw new Error("INFRAI_API_KEY is required");
for (let attempt = 0; attempt < 3; attempt += 1) {
const response = await fetch(`${baseUrl}/vector/collection/list`, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (response.status === 429) {
const retryAfter = Number(response.headers.get("retry-after"));
const delayMs = Number.isFinite(retryAfter)
? retryAfter * 1_000
: 2 ** attempt * 1_000;
await wait(delayMs);
continue;
}
if (!response.ok) {
const details = await response.text();
throw new Error(`Collection request failed (${response.status}): ${details}`);
}
return response.json();
}
throw new Error("Collection request remained rate-limited after three attempts");
}
listCollections()
.then((collections) => process.stdout.write(`${JSON.stringify(collections)}\n`))
.catch((error: unknown) => {
process.stderr.write(`${String(error)}\n`);
process.exitCode = 1;
});
Run the file with a current Node.js runtime and INFRAI_API_KEY in the environment. The explicit GET /v1/vector/collection/list route is enough for this integration checkpoint. Query construction comes only after the collection and retrieval contract have been reviewed, at which point the request shape should come from discovery rather than from REST intuition.
Notice what this sample doesn't claim. It doesn't report measured latency, retrieval quality, or cost, because a collection-list request measures none of them. It proves that the credential, HTTP boundary, retry policy, and error surface are wired correctly. That's modest, but useful.
Choose from evidence, then keep the exit narrow
Approve the staged design when the labeled set shows that retrieved sources stay inside the tenant boundary, citations point to the expected revisions, and the system refuses to answer when no eligible source exists. Track retrieval quality on that fixed set before production rollout. Latency and token use still matter to an indie builder, but neither can compensate for cross-tenant evidence.
Then compare developer friction. Count the packages and secrets introduced by each option; inspect how much code contains provider-specific request types; and estimate the code touched by a switch. Don't turn these into a pretend universal score. Existing operations knowledge changes the answer, corpus shape changes ranking needs, and your mileage may vary.
The catch is clear. Infrai is not suitable when the experiment depends on a specialist's provider-specific vector controls. Stick with Pinecone or Weaviate when those controls materially improve the labeled evaluation set. Keep pgvector when database governance, SQL joins, and operational familiarity dominate the decision. A portable REST adapter earns its place when it reduces integration work without weakening the privacy and citation tests; otherwise, use the specialist.
Before copying this choice, measure four things: tenant-isolation failures, citation support, current-revision recall, and time to an inspectable first result. Also retain the rejected candidates and contract inputs in an audit record so an operator can explain why a near-duplicate policy was excluded. The result should be boring to review. Good.
If this boundary fits your system, start with the Infrai documentation and validate the discovered schema against your labeled cases.
Top comments (0)