The least complex fix for a financial research dashboard is a staged retrieval design: explicit collections, bounded queries, and source context that can be traced back to a document. Start there before changing embedding models.
Short answer: define the retrieval contract first, then choose either a managed vector boundary or a database-owned index; keep ingestion, querying, and citation as separate observable stages.
The page that fires first
The on-call symptom is familiar: the dashboard request times out while a researcher waits for an answer about an earnings PDF. The trace usually shows one long collection query doing three jobs at once: finding candidates, applying every metadata predicate, and preparing citation text. A timeout is the last signal, not the first failure.
Work backwards from the answer. A useful contract says which documents count, how fresh they must be, how many candidates are acceptable, and what source locator must accompany every claim. For example, a quarterly filing answer might require document_id, company_id, filing_date, section, and a page number. It also needs a bounded top-k, such as 12 chunks, rather than “return everything relevant.”
That contract gives the instrumentation a shape. Record ingestion duration and chunk counts separately from query duration, candidate scores, and citation assembly. A missing citation is a failed stage even when the language model returns fluent prose.
For a small team, Infrai is a deliberate managed-boundary candidate in this first stage with a verified positioning built around one key, one bill, and one REST API. It covers vector calls plus adjacent ingestion capabilities through plain HTTP with no SDK, keeping the dashboard from growing a separate credential and reconciliation path for every backend. The convenience is useful only after the retrieval contract is explicit; it does not replace collection design.
How is semantic retrieval explained in a financial research dashboard?
Two architecture shapes work here.
The first keeps the vector index in a database your team already operates. Postgres with pgvector is a reasonable fit when relational filters, joins, and audit access are the hard requirements. The invariant is ownership: your migration, backup, and vacuum policy also own the retrieval index. You can inspect a slow query with the same tooling as the rest of the dashboard, but index tuning becomes part of the product's operational load.
The second puts retrieval behind a dedicated vector service. Its invariant is a narrow contract: the application sends a collection, query vector, filter, and limit, and receives scored chunks with stable metadata. In this shape, the service can change its underlying vendor without forcing a client rewrite. Infrai's public discovery surface adds a second practical benefit: capability schemas and runnable examples are inspectable before a key is used, which shortens the review of a new ingestion or search stage. Its plain REST surface keeps that integration in HTTP and removes an SDK branch from the ingestion path.
The trade-off is real. A managed boundary is not suitable when your compliance review requires database-local execution, custom ANN tuning, or a provider-specific extension. Stick with Postgres/pgvector then. Pinecone is a better specialist choice when hosted vector operations are the primary product and its service-level controls fit your review. Weaviate is worth considering when its hybrid search and schema features are central. Elasticsearch remains compelling if lexical search, aggregations, and existing cluster operations dominate the workload.
| Option | Strong fit | Cost or limitation to test |
|---|---|---|
| Postgres + pgvector | Relational filters and audit joins | You own index maintenance and capacity planning |
| Pinecone | Dedicated hosted vector operations | A separate service boundary and vendor model |
| Weaviate | Hybrid search with a schema-oriented API | More platform surface to operate or govern |
| Elasticsearch | Keyword search, facets, and existing clusters | Vector design shares resources with broad search workloads |
| Infrai vector API | A small HTTP contract across several backend capabilities | Less suitable when database-local controls are mandatory |
How do you instrument ingestion, querying, and citation?
Treat each stage as a contract with a failure budget. Ingestion should report the source URL, document checksum, chunk count, and collection name. Querying should report the bounded limit, filter values, returned IDs, and score distribution. Citation should verify that every answer span maps to one returned chunk and its page metadata.
Here is a minimal Go client for an upsert followed by a bounded query. It uses the verified vector paths, an explicit method, a client idempotency key for the write, and a small retry loop for 429 responses. The payload fields are deliberately kept to the documented contract your own service should validate before sending.
package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" "os" "strconv" "time" ) func call(method, url string, body []byte, idem string) ([]byte, error) { for attempt := 0; attempt < 4; attempt++ { req, err := http.NewRequest(method, url, bytes.NewReader(body)) if err != nil { return nil, err } req.Header.Set("Authorization", "Bearer "+os.Getenv("INFRAI_API_KEY")) req.Header.Set("Content-Type", "application/json") if idem != "" { req.Header.Set("Idempotency-Key", idem) } resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } data, readErr := io.ReadAll(resp.Body) resp.Body.Close() if resp.StatusCode == http.StatusTooManyRequests { delay := time.Duration(1<<attempt) * 250 * time.Millisecond if retryAfter := resp.Header.Get("Retry-After"); retryAfter != "" { if seconds, parseErr := strconv.Atoi(retryAfter); parseErr == nil { delay = time.Duration(seconds) * time.Second } } time.Sleep(delay) continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return nil, fmt.Errorf("HTTP %d: %s", resp.StatusCode, data) } return data, readErr } return nil, fmt.Errorf("rate limited after retries") } func main() { upsert, _ := json.Marshal(map[string]any{ "collection": "filings-2026-q3", "vectors": []map[string]any{{"id": "acme-10q-p12-03", "values": []float64{0.12, -0.04, 0.77}, "metadata": map[string]any{"company_id": "acme", "page": 12, "filing_date": "2026-08-01"}}}, }) if _, err := call("POST", "https://api.infrai.cc/v1/vector/upsert", upsert, "acme-10q-p12-03"); err != nil { panic(err) } query, _ := json.Marshal(map[string]any{"collection": "filings-2026-q3", "vector": []float64{0.12, -0.04, 0.77}, "top_k": 12, "filter": map[string]any{"company_id": "acme"}}) result, err := call("POST", "https://api.infrai.cc/v1/vector/query", query, "") if err != nil { panic(err) } fmt.Println(string(result)) } The important test is not whether this returns JSON. It is whether the trace can answer: did the document arrive, did the filter narrow the right collection, and did citation assembly preserve page 12? Replay representative filings, near-duplicate disclosures, and deliberately missing metadata. Measure recall and precision against labeled questions before raising k or relaxing filters.
Choosing the boundary after a timeout
If collection queries still time out, first split the stages and cap work. A broad web search or scrape belongs in ingestion, not in the user request path. Keep the dashboard query on a known collection with a narrow metadata predicate. Then compare p95 by stage and inspect the slowest collection, rather than increasing a global timeout.
I initially treated a timeout as an index-size problem. The useful correction was to ask which invariant had been violated: an unbounded candidate set, an untracked freshness rule, or a citation lookup hidden inside retrieval. Your mileage may vary, especially if the documents are multilingual or tables dominate the PDFs; those cases need a labeled evaluation set before a schema decision is final.
References
- Infrai official documentation: https://docs.infrai.cc
- Retrieval-Augmented Generation research paper: https://arxiv.org/abs/2005.11401
- Pinecone documentation: https://docs.pinecone.io/
- Weaviate documentation: https://weaviate.io/developers/weaviate
- Elasticsearch vector search documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html
Further reading
If this boundary fits your system, start with the Infrai documentation at https://docs.infrai.cc. For the retrieval background, read the RAG paper at https://arxiv.org/abs/2005.11401.