Grounding from catalog
Grounding means giving an LLM (and thus the agent) context from your own documents so its answers are based on real content, not just training data. You retrieve relevant smart bites from the Vector Catalog with Vector Search, pass them to the LLM as context, and attach source lineage so every part of the answer can be traced to a document and run.
Flow
- User question — e.g. “What is the refund policy?”
- Retrieve — Run Vector Search (semantic retrieval, with optional metadata filters) over the appropriate collection. Get top-k smart bites with metadata and source lineage.
- Build context — Format the retrieved chunks (and optionally metadata) into the prompt. Include document ID, run ID, or other lineage so the model can “cite” them.
- Generate — Send the prompt to the LLM. The model generates an answer using the provided context.
- Return and cite — Return the answer to the user and attach source lineage (which document(s), which chunks) so the answer is grounded and verifiable.
Why source lineage matters
- Trust — Users can verify that the answer comes from real docs, not hallucination.
- Audit — Compliance and legal can trace which documents supported which response.
- Debug — When the answer is wrong, lineage shows which chunk was used so you can fix extraction or retrieval.
Always expose lineage in the UI (e.g. “Source: Contract ABC, Section 4.2”) or in the API response.
Implementation details
- Collection choice — Query the collection that holds the right document set (contracts, policies, etc.). See Vector Search overview.
- Filtering — Use metadata filters to scope retrieval (e.g. date, document type). See Filtering.
- Number of chunks — Balance context length (token limits) and coverage. Start with top 5–10; tune for your model and use case. See Vector Search best practices.
- Prompt design — Instruct the LLM to answer only from the provided context and to cite document/section when possible. Reduces hallucination and reinforces grounded answers.
Common pitfalls
- No lineage in response — Always include source document and, if available, section or chunk ID in the answer or metadata.
- Wrong or stale collection — Ensure the catalog is updated via workflow orchestration and that you’re querying the right collection.
- Too few chunks — If the answer isn’t in the retrieved set, increase k or improve retrieval (filters, chunking, schema). See Vector Search best practices.
Next steps
- Agents overview — What agents need from Bundata.
- Knowledge assistants — Use-case patterns.
- Vector Catalog: Lineage — Lineage and freshness.