B Blengi docs

Build your agent

Smart Segments

Smart Segments split one agent's knowledge into named areas β€” Products, Support, Docs β€” routed by the page the visitor is chatting from. A visitor on /products/… gets product answers first; a visitor in your help center gets support answers first. The rest of the knowledge base stays reachable: segments prioritize, they never wall off.

How a conversation gets its segment

  1. The visitor opens the chat on some page. The page's URL path is matched against every segment's path list β€” the most specific (longest) match wins; unmatched pages go to the default segment.
  2. The winning segment is stored on the conversation once, at creation. Navigating to other pages mid-conversation never re-routes it β€” context stays stable for the whole chat.
  3. Every answer first searches the conversation's segment. If nothing clears the agent's confidence threshold there, the agent automatically runs one fallback pass across all segments (with a small preference for the home segment on near-ties) before giving up.
  4. Only when the whole knowledge base has no grounded answer does Strict Knowledge Mode defer β€” a segment miss alone never triggers the fallback message.
No fallback chains, by design
There is exactly one fallback: segment β†’ everything. Configurable "try segment B, then C, then D" chains multiply the ways retrieval can silently do the wrong thing, so they don't exist. Every cross-segment fallback is recorded on the turn's trace, so you can see how often visitors needed knowledge from outside their segment.

URL path patterns

  • Patterns match the URL path only β€” query strings and #fragments are ignored; matching is case-insensitive.
  • A path matches itself and everything under it: /products also covers /products/red-pen, but never /products-old (boundaries are respected).
  • A trailing /* is accepted as the same section match: /docs/* ≑ /docs.
  • * alone matches every page β€” useful as an explicit catch-all on a non-default segment.
  • The longest matching pattern wins across all segments: with /products (Products) and /products/manuals (Docs), a visitor on /products/manuals/v2 lands in Docs.

Setting it up

  1. Open your agent β†’ Smart Segments and add segments. The first one you create becomes the default (you can move the star later). Give each segment the URL paths that should route into it; the default usually needs none.
  2. On the Sources page, assign each knowledge source to a segment with the per-row picker. Assignment is instant β€” membership lives in the database, so no re-crawl or re-index happens when you move a source.
  3. Sources you never assign behave as default-segment knowledge, so an agent that predates segments keeps answering exactly as before.
  4. Rehearse in the Playground: the Scenario tab gets a Knowledge segment override so you can ask "what would a /products visitor get?" without opening the live site. The Diagnostics tab shows whether the reply came from the home segment or via the fallback.

What segments do NOT change

  • Curated answers, workflows, and the human-handoff / booking shortcuts run before retrieval and ignore segments entirely.
  • The widget embed is unchanged β€” routing happens server-side from the page URL the widget already reports. Nothing to re-install.
  • Agents with zero segments behave byte-identically to before the feature existed.
  • Deleting a segment re-points its sources at the default segment (deleting the last one turns the feature off); conversations pinned to it simply fall back to whole-knowledge-base retrieval.
Sticky by contract
The segment is chosen when the conversation starts and never re-resolved β€” a visitor who wanders from /products to /support mid-chat keeps the Products context they started in. If they return after 24 hours of inactivity, a fresh conversation (and fresh routing) begins.

Plans

The per-plan Smart Segments per agent limit controls the feature: blank means unlimited, 0 hides it, a number caps how many segments each agent may define. Platform admins set it under Admin β†’ Plans.