Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.animam.ai/llms.txt

Use this file to discover all available pages before exploring further.

Segments allow you to adapt the chatbot’s responses based on the page context.

Concept

A segment is a specific context. For example:
  • Home page → segment landing
  • Pricing page → segment pricing
  • Support page → segment support
The chatbot only uses the corpus associated with the active segment.

Usage

Via HTML

<!-- Home page -->
<script
  src="https://animam.ai/widget.js"
  data-tenant="your-slug"
  data-segment="landing"
></script>

<!-- Pricing page -->
<script
  src="https://animam.ai/widget.js"
  data-tenant="your-slug"
  data-segment="pricing"
></script>

Via JavaScript

// Change segment dynamically
window.Animam.setSegment("checkout")
Useful for SPAs (Single Page Applications) where the segment changes without page reload.

Dashboard configuration

  1. Go to Dashboard > Knowledge Base
  2. For each entry, assign one or more segments
  3. Entries without a segment are available everywhere

Concrete example

E-commerce scenario

SegmentCorpusExample question
landingProduct presentation”What is your product?”
pricingPricing, subscriptions”What’s the price?”
checkoutPayment, shipping”What payment methods?”
supportTechnical FAQ”How do I reset my password?”

Implementation

<!-- pages/index.html -->
<script src="https://animam.ai/widget.js" data-tenant="shop" data-segment="landing"></script>

<!-- pages/pricing.html -->
<script src="https://animam.ai/widget.js" data-tenant="shop" data-segment="pricing"></script>

<!-- pages/checkout.html -->
<script src="https://animam.ai/widget.js" data-tenant="shop" data-segment="checkout"></script>

Default segment

If no segment is specified, the chatbot uses:
  1. Entries from the default segment
  2. Entries without an assigned segment

Best practices

Create a global segment for general questions (hours, contact, about) available on all pages.
  • Limit the number of segments (5-10 max)
  • Name them clearly (pricing not seg_01)
  • Test each segment individually