Skip to main content
Browse docs

Using Knowledge Base in Chat

This tutorial shows how to attach knowledge base assets to your chat conversations so the model receives relevant organizational context, how to verify citations in responses, and how to manage the knowledge context for each session.

Use this page when

  • You want to attach knowledge base assets to chat conversations for context injection.
  • You need to verify citations in model responses and understand the knowledge grounding flow.
  • You are managing which knowledge assets are bound to your gateway for chat use.

Primary audience

  • Primary: Technical Engineers (knowledge-enriched chat users)
  • Secondary: Technical Leaders (knowledge governance), Content owners

Prerequisites

  • Authenticated access to the Keeptrusts chat workbench
  • At least one active knowledge asset promoted and bound to your gateway
  • Familiarity with the first conversation tutorial

Step 1: Understand Knowledge Base Integration

Keeptrusts Knowledge Base stores versioned context assets — documents, policies, procedures, or reference material — that the gateway can inject into model prompts. When a knowledge asset is bound to your gateway, the gateway automatically recalls relevant content and includes it as context alongside your message.

The flow works like this:

User message
→ Gateway recalls bound active knowledge assets
→ Relevant context injected into model prompt
→ Model generates response using injected context
→ Citation records written for each used asset
→ Response returned with citation annotations

Step 2: Check Available Knowledge Assets

Before starting a conversation, verify which knowledge assets are available:

  1. Open the management console.
  2. Navigate to Knowledge Base in the sidebar.
  3. Review the list of assets. Each asset shows:
FieldDescription
NameDescriptive title of the asset
Statusdraft, promoted, or active
VersionCurrent version number
BindingsWhich gateways this asset is bound to

Only assets with status active and bound to your gateway are available in chat.

Step 3: Start a Knowledge-Enriched Conversation

  1. Open the chat workbench from the console.

  2. Select a model from the model picker.

  3. Ask a question related to your organization's knowledge assets:

    What is our company's data retention policy for customer records?
  4. Send the message.

The gateway matches your query against bound knowledge assets and injects relevant content into the prompt sent to the model.

Step 4: Identify Citations in Responses

When the model uses injected knowledge context, the response includes citation annotations. Look for:

  • Inline citation markers — references like [1], [2] within the response text.
  • Citation footer — a list at the bottom of the response mapping each marker to the source knowledge asset.

Example response with citations:

According to company policy, customer records must be retained for
a minimum of seven years after the last interaction [1]. Records
containing financial data are subject to additional regulatory
requirements and must be retained for ten years [2].

Sources:
[1] Data Retention Policy v3.2
[2] Financial Compliance Handbook v1.1

Step 5: Verify Citation Accuracy

To confirm that citations reference actual knowledge assets:

  1. Note the asset name and version from the citation footer.
  2. Open the management console and navigate to Knowledge Base.
  3. Search for the cited asset by name.
  4. Open the asset and verify its content matches the cited information.
Citations are recorded as audit events. You can view citation records in the console's Events page to see exactly which assets were used in each conversation turn.

Step 6: Manage Knowledge Context in a Session

Viewing active context

The chat workbench may display a Knowledge Context indicator showing which assets are active for the current session. This depends on your deployment's UI configuration.

Context scope

Knowledge assets are injected per-message, not per-session. Each message you send triggers a fresh recall against bound assets. This means:

  • You do not need to "attach" knowledge manually for each message.
  • The gateway automatically determines relevance based on your query.
  • Different messages in the same conversation may use different knowledge assets.

Limiting context

If you want to focus the model on specific topics without knowledge injection, you can phrase your queries to avoid triggering knowledge recall, or ask your administrator to adjust knowledge bindings.

Step 7: Add New Knowledge Assets

If you need to add content to the knowledge base:

  1. In the management console, go to Knowledge Base.
  2. Click Create Asset.
  3. Provide a name, description, and upload or paste the content.
  4. Save the asset — it starts in draft status.
  5. When ready, promote the asset to make it eligible for binding.
  6. Bind the asset to the relevant gateway.
  7. The asset's status becomes active once bound.

You can also manage knowledge assets through the CLI:

kt knowledge-base create --name "Security Policy" --file ./security-policy.md
kt knowledge-base promote --id <asset-id>
kt knowledge-base bind --id <asset-id> --gateway <gateway-id>

Step 8: Verify Knowledge Usage in Events

Each message that uses knowledge context generates citation records:

  1. Open the management console Events page.
  2. Find the event for your chat message.
  3. In the event detail, look for the Citations section.
  4. Each citation entry shows:
FieldDescription
Asset IDThe knowledge asset used
Asset nameHuman-readable asset name
VersionThe version of the asset at time of use
Relevance scoreHow closely the asset matched the query

Troubleshooting

ProblemSolution
No citations in responsesVerify knowledge assets are active and bound to your gateway
Incorrect or outdated citationsCheck the asset version — update and re-promote if content is stale
Knowledge not matching queriesReview asset content for keyword alignment with your queries
Too much context injectedAsk your admin to adjust binding scope or asset relevance thresholds

Next steps

For AI systems

  • Canonical terms: Keeptrusts Knowledge Base, knowledge assets, knowledge injection, context injection, citations, knowledge grounding, asset promotion lifecycle (draft → promoted → active), bindings, relevance score, kt knowledge-base / kt kb.
  • Flow: User message → gateway recalls bound active assets → relevant context injected into prompt → model responds → citation records written → response returned with citation annotations.
  • Console path: Knowledge Base in sidebar → asset list (Name, Status, Version, Bindings).
  • Best next pages: Team Conversations, Conversation Export, System Prompts.

For engineers

  • Prerequisites: at least one knowledge asset with status active and bound to your gateway; familiarity with the console Knowledge Base section.
  • Validation: Ask a question related to a bound asset → verify response includes citation annotations. Check Events console → find the event → verify Citations section shows asset ID, version, and relevance score.
  • Troubleshooting: No citations = asset may be draft (not promoted) or not bound to your gateway.

For leaders

  • Knowledge grounding ensures AI responses are anchored to approved organizational content, reducing hallucination risk.
  • Citations provide verifiable provenance — every response can be traced back to the source document and version.
  • Versioned assets with promotion lifecycle (draft → promoted → active) ensure only reviewed content reaches production chat.
  • Knowledge assets consume context window tokens — monitor token breakdown in analytics for cost impact.