DocumentationOrganization Groups

Organization Groups

5 minLast updated: 2026-03-31

Recursive Group Hierarchy

Groups provide an unlimited-depth organizational structure. A typical hierarchy:

Company (root)
├── Region: Serbia
│   ├── Branch: Belgrade Main
│   │   └── Department: Customer Service
│   └── Branch: Novi Sad
├── Region: Croatia
│   └── Branch: Zagreb
└── Region: Bosnia
    └── Branch: Sarajevo

Each group has a parent_id (NULL for root), depth, and a materialized path (e.g., "1/5/12") for fast ancestor/descendant queries.

Group Types

Define custom group types to match your organization: Region, Branch, Department, Team, etc. Each group is assigned a type for filtering and display.

Agent Scoping

Every agent belongs to a group via group_id. An agent can see data from:

  • Its own group
  • All descendant groups (children, grandchildren, etc.)

This is enforced by agentScoping.js using getSiblingScope() and scopedQuery.js with getGroupScope(). All CRM contacts, orders, pipelines, and other entities respect group scoping.

Knowledge Base Inheritance

Knowledge bases can be agent-specific OR group-shared. When an agent processes a query, RAG searches:

  1. Agent's own knowledge base
  2. Agent's group knowledge base
  3. All ancestor group knowledge bases (parent → grandparent → root)

This means a branch agent inherits company-wide knowledge while also having branch-specific info.

Structure UI

Manage groups in Dashboard → Structure. Features include: tree navigation, detail panel, drag-drop reorganization, search, and context menu for create/edit/delete/move operations.

Was this article helpful?