Skip to content

Commit 5a0f369

Browse files
committed
docs: Migrate Cube AI/BI docs
1 parent 71ce226 commit 5a0f369

33 files changed

+2150
-269
lines changed

docs/pages/_meta.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@ module.exports = {
2121
// toc: false,
2222
// },
2323
// },
24-
docs: {
25-
// type: "page",
26-
title: "[Demo] MDX Components",
27-
display: "hidden",
24+
// docs: {
25+
// // type: "page",
26+
// title: "[Demo] MDX Components",
27+
// display: "hidden",
28+
// },
29+
30+
cube: {
31+
type: "page",
32+
title: "Cube",
2833
},
2934

3035
product: {
3136
type: "page",
32-
title: "Documentation",
37+
title: "Cube Core",
3338
},
3439
};

docs/pages/cube/_meta.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
introduction: "Introduction",
3+
workbooks: "Workbooks",
4+
administration: "Administration",
5+
embed: "Embed & API",
6+
changelog: "Product Updates",
7+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
ai: "AI",
3+
"user-attributes": "User Attributes",
4+
"roles-and-permissions": "Roles & Permissions",
5+
"spaces-agents-models": "Spaces, Agents, Models",
6+
"agent-rules": "Agent Rules",
7+
"memory-isolation": "Agent Memories",
8+
};
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Agent Rules
2+
3+
_Understanding Agent Rules configuration and behavior in Cube._
4+
5+
Agent Rules in Cube provide a powerful way to customize and control how AI agents behave within specific spaces. Rules act as contextual instructions that guide agents' responses and analysis, ensuring consistent behavior aligned with your business logic and domain expertise.
6+
7+
## Rule Types
8+
9+
### Always Rules
10+
11+
**Always Rules** are automatically applied to every agent interaction within the space, regardless of the specific query or context.
12+
13+
**Use Cases:**
14+
- Fundamental business definitions and context
15+
- Consistent calculation methods
16+
- Default analysis approaches
17+
- Domain-specific terminology
18+
19+
**Example Always Rules:**
20+
```
21+
Sales efficiency is deal size divided by sales cycle length
22+
```
23+
24+
```
25+
When analyzing customer data, always consider seasonality patterns from our retail business
26+
```
27+
28+
```
29+
Revenue should be calculated using our standard GAAP accounting principles
30+
```
31+
32+
### Agent Requested Rules
33+
34+
**Agent Requested** rules are conditionally applied when the agent determines they are relevant to the current query or analysis. The agent intelligently selects which rules to use based on the context.
35+
36+
**Use Cases:**
37+
- Specialized analysis techniques
38+
- Context-specific guidance
39+
- Advanced calculation methods
40+
- Scenario-specific instructions
41+
42+
**Example Agent Requested Rules:**
43+
```
44+
If you asked to analyze sales efficiency start with correlation to WSE
45+
```
46+
47+
```
48+
For customer segmentation analysis, use RFM methodology (Recency, Frequency, Monetary)
49+
```
50+
51+
```
52+
When analyzing marketing performance, compare against industry benchmarks where available
53+
```
54+
55+
## Best Practices
56+
57+
### Rule Hierarchy and Organization
58+
59+
- **Start with Always rules** for fundamental business context
60+
- **Use Agent Requested rules** for specialized scenarios
61+
- **Keep rules specific and actionable** rather than vague
62+
- **Test rules** with actual queries to ensure they work as expected
63+
64+
### Writing Effective Rules
65+
66+
**Good Rule Examples:**
67+
- "Customer churn rate should be calculated as customers lost / total customers at start of period"
68+
- "When analyzing quarterly performance, always compare against same quarter previous year"
69+
- "For financial analysis, use our fiscal year starting in October"
70+
71+
**Poor Rule Examples:**
72+
- "Be helpful" (too vague)
73+
- "Always be accurate" (redundant)
74+
- "Consider all factors" (too broad)
75+
76+
### Domain-Specific Rules
77+
78+
**E-commerce Example:**
79+
```
80+
Always Rule: "Customer lifetime value equals average order value × purchase frequency × customer lifespan"
81+
Agent Requested: "For cart abandonment analysis, segment by device type and traffic source"
82+
```
83+
84+
**SaaS Example:**
85+
```
86+
Always Rule: "MRR growth rate should exclude one-time charges and setup fees"
87+
Agent Requested: "When analyzing churn, differentiate between voluntary and involuntary churn"
88+
```
89+
90+
### Contextual Guidance
91+
92+
Rules should provide context that agents might not inherently understand about your business:
93+
94+
```
95+
Always Rule: "Our peak season is Q4, with 40% of annual revenue typically occurring in December"
96+
Agent Requested: "For inventory analysis, consider our 6-week lead time for international suppliers"
97+
```
98+
99+
## Rule Conflicts and Resolution
100+
101+
### How Cube Handles Conflicting Rules
102+
103+
Based on the rule configuration system, when multiple rules could apply to the same query, the conflict resolution strategy would likely include:
104+
105+
1. **Rule type hierarchy** (specific behavior needs verification)
106+
2. **Rule specificity** - more specific rules typically override general ones
107+
3. **Rule order** - the system may consider rule creation order or explicit priority
108+
4. **Agent decision-making** for complementary vs conflicting guidance
109+
110+
### Example Conflict Scenarios
111+
112+
**Scenario 1: Direct Contradiction**
113+
```
114+
Rule A (Always): "Revenue recognition follows monthly billing cycles"
115+
Rule B (Always): "Revenue should be recognized quarterly"
116+
117+
Resolution: The agent will flag this conflict and may ask for clarification
118+
```
119+
120+
**Scenario 2: Complementary Rules**
121+
```
122+
Rule A (Always): "Sales efficiency is deal size divided by sales cycle length"
123+
Rule B (Agent Requested): "When analyzing sales efficiency, include pipeline velocity metrics"
124+
125+
Resolution: Both rules work together - B provides additional context to A
126+
```
127+
128+
**Scenario 3: Specificity Override**
129+
```
130+
Rule A (Always): "Use standard deviation for all variance calculations"
131+
Rule B (Agent Requested): "For customer behavior analysis, use median absolute deviation instead of standard deviation"
132+
133+
Resolution: Rule B takes precedence for customer behavior queries due to higher specificity
134+
```
135+
136+
### Best Practices for Avoiding Conflicts
137+
138+
1. **Review existing rules** before adding new ones
139+
2. **Use specific triggers** in Agent Requested rules
140+
3. **Test rule combinations** with sample queries
141+
4. **Document rule intentions** clearly
142+
5. **Regular rule audits** to identify and resolve conflicts
143+
144+
## Current Limitations
145+
146+
### Current State: Space-Level Rules Only, Always Rules Only
147+
148+
- Rules are currently configured at the **Space level**
149+
- All agents within a space inherit the same set of rules
150+
- Individual agent customization is not yet available
151+
152+
## Getting Started
153+
154+
1. **Assess Your Use Case**: Identify the key business context and calculations your agents need to understand
155+
2. **Start Simple**: Begin with 2-3 Always rules covering your most important business definitions
156+
3. **Add Specificity**: Implement Agent Requested rules for specialized scenarios
157+
4. **Test and Iterate**: Use real queries to validate rule effectiveness
158+
5. **Scale Gradually**: Add more rules based on actual usage patterns and feedback
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AI
2+
3+
_AI features and administration in Cube._
4+
5+
## Chats History
6+
7+
Admins can access users chat history through <Btn>Admin → Chats History</Btn>. It's possible to search specific chats by the first message content or chat UUID.
8+
9+
<video
10+
autoPlay
11+
muted
12+
loop
13+
playsInline
14+
className="w-full aspect-video rounded-xl"
15+
src="https://ucarecdn.com/c0a5f8ac-9c3c-41d7-80c3-95f533476ad4/"
16+
></video>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Agent Memories
2+
3+
_Learn how Cube enforces memory isolation across tenants, spaces, and users._
4+
5+
Memory in Cube allows Agents to learn from and recall past interactions, user preferences, and contextual information. When users interact with Agents, relevant information is stored as memories that can be retrieved in future conversations, enabling more personalized and context-aware responses. Memories help Agents understand user preferences, remember previous decisions, and provide continuity across sessions.
6+
7+
Memories are scoped and enforced at the Tenant/Space boundary. Cube applies both application-layer and (optionally) infrastructure-layer isolation so one customer's end users cannot see another customer's memories.
8+
9+
## How It Works
10+
11+
### Space-Scoped Memories
12+
13+
Cube memories are stored at the Space level. Agents only learn from and retrieve memories within the current Space, ensuring no cross-Space exposure by design.
14+
15+
### Tenant-Aware Security Context
16+
17+
Every request carries a tenant-bound security context (JWT). Cube maps that context to an app/tenant ID and uses it across caching, orchestration, and query flows. This is the backbone of multi-tenancy isolation.
18+
19+
### RBAC and Policy Guardrails
20+
21+
Role-based access policies gate what entities and content are visible within a tenant. These same guardrails apply to what agents can read and write as memories.
22+
23+
### Data Model and API Isolation
24+
25+
Even when using the SQL API or custom views, hidden members and non-public entities remain inaccessible. Multitenancy configuration ensures queries and artifacts resolve only within the current tenant's scope.
26+
27+
### Optional Infrastructure Isolation
28+
29+
Many customers run in shared multi-tenant regions, but dedicated infrastructure and BYOC (Bring Your Own Cloud) variants are available. These provide stronger blast-radius isolation at the cluster, storage, and key-management levels.
30+
31+
## Practical Implications
32+
33+
- **Tenant Separation**: An end user in Customer A can only create and retrieve memories in Customer A's Spaces
34+
- **Cross-Tenant Protection**: Memories are not retrievable by Customer B's users or agents, because requests from B carry a different security context and resolve to different Space and tenant IDs
35+
- **Intra-Tenant Controls**: Even within a customer, RBAC and policies can further restrict which users or agents can contribute to or benefit from memories
36+
37+
## Technical Implementation
38+
39+
Cube ensures memory isolation through multiple layers of security controls:
40+
41+
1. **Tenant Isolation**: Every request is scoped to a specific tenant via JWT and middleware
42+
2. **User Isolation**: Additional user-level filtering for user-mode memories
43+
3. **Automatic Filtering**: Database queries are automatically filtered by tenant using decorators
44+
4. **Vector Store Security**: All vector searches include tenant and user filters
45+
5. **Container Isolation**: Each tenant gets its own dependency injection container
46+
6. **JWT Security**: All security context comes from cryptographically signed JWT tokens
47+
7. **Memory Mode Controls**: Configurable memory isolation levels (user/space/disabled)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Roles & Permissions
2+
3+
_Understanding user roles and access control in Cube._
4+
5+
Cube implements a role-based access control system with three main user roles: Admin, Developer, and User. Each role has specific permissions and access levels designed to support different responsibilities within the platform.
6+
7+
## Deployment Structure
8+
9+
- Database connections are managed through Semantic Model Deployments
10+
- Multiple Semantic Model Deployments can exist under one account
11+
- Roles can be either global (across all deployments) or deployment-specific
12+
- Admin role is always global
13+
14+
## Role Permissions
15+
16+
### Admin Role
17+
18+
- Has highest level of privileges
19+
- Can manage semantic models
20+
- Can manage other users
21+
- Has access to admin section
22+
- Full query capabilities
23+
24+
### Developer Role
25+
26+
- Can create and edit semantic models
27+
- Can execute SQL queries against data sources
28+
- Can create and edit workbooks
29+
- Can create and edit data apps
30+
- No access to admin settings
31+
32+
### User Role
33+
34+
- Can query semantic models
35+
- Can create and edit workbooks
36+
- Can create and edit data apps
37+
- Can execute Semantic SQL queries
38+
- Cannot make changes to semantic models
39+
- Cannot query source data directly
40+
41+
## Future Implementation
42+
43+
A Viewer role is planned for future implementation with the following capabilities:
44+
45+
- Use Analytics Chat with ability to query Semantic Views and existing reports
46+
- View (read-only) access to shared data apps
47+
48+
## Agent Permissions
49+
50+
Agents are connected to Semantic Model Deployments and inherit the permission level of the user they are operating under.
51+
52+
## Typical Usage Scenarios
53+
54+
- Users: Typically data consumers and analysts
55+
- Developers: Usually data stewards and data engineers
56+
- Admin: Typically assigned to data engineers managing the entire Cube instance

0 commit comments

Comments
 (0)