Skip to content

feat: Add cube description to members for vector search indexing and agent output#10593

Closed
paveltiunov wants to merge 5 commits intomasterfrom
cursor/cube-description-vector-search-0b7c
Closed

feat: Add cube description to members for vector search indexing and agent output#10593
paveltiunov wants to merge 5 commits intomasterfrom
cursor/cube-description-vector-search-0b7c

Conversation

@paveltiunov
Copy link
Copy Markdown
Member

@paveltiunov paveltiunov commented Apr 1, 2026

.

@github-actions github-actions bot added client:core Issues relating to the JavaScript client SDK rust Pull requests that update Rust code javascript Pull requests that update Javascript code labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 85.36585% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.58%. Comparing base (c95317b) to head (d3d5071).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...ema-compiler/src/compiler/CubeToMetaTransformer.ts 75.00% 1 Missing and 1 partial ⚠️
packages/cubejs-backend-shared/src/env.ts 0.00% 1 Missing ⚠️
...ql/cubeclient/src/models/v1_cube_meta_dimension.rs 0.00% 1 Missing ⚠️
...esql/cubeclient/src/models/v1_cube_meta_measure.rs 0.00% 1 Missing ⚠️
...esql/cubeclient/src/models/v1_cube_meta_segment.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10593       +/-   ##
===========================================
+ Coverage   57.88%   78.58%   +20.70%     
===========================================
  Files         225      475      +250     
  Lines       17581    92866    +75285     
  Branches     3614     3616        +2     
===========================================
+ Hits        10176    72980    +62804     
- Misses       6861    19341    +12480     
- Partials      544      545        +1     
Flag Coverage Δ
cube-backend 57.88% <66.66%> (+<0.01%) ⬆️
cubesql 83.42% <90.62%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paveltiunov paveltiunov marked this pull request as ready for review April 1, 2026 03:26
@paveltiunov paveltiunov requested review from a team as code owners April 1, 2026 03:26
cursoragent and others added 5 commits April 1, 2026 03:41
…agent output

Add cubeDescription field to measures, dimensions, and segments in the meta
response. This propagates the parent cube's description down to each member,
making it available for vector search indexing (e.g., via LangChain document
loader) and AI agent consumption.

Changes:
- CubeToMetaTransformer: Add cubeDescription to member configs
- OpenAPI spec: Add cubeDescription field to member schemas
- Rust cubeclient models: Add cube_description field
- Client types: Add cubeDescription to BaseCubeMember
- Annotations: Include cubeDescription in annotation output
- Tests: Add assertions for cubeDescription in meta endpoints

Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
Add CUBEJS_MAX_EMBEDDING_DESCRIPTION_LENGTH environment variable to limit
the number of characters in description fields exposed through the meta API.
When set to a positive integer, all description and cubeDescription fields
are truncated to that length during meta transformation.

This prevents excessively long descriptions from consuming too many tokens
when indexed by embedding models (e.g., via LangChain's CubeSemanticLoader).
Default value of 0 means no truncation (backward compatible).

Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
Add cube_description: None to all CubeMetaMeasure and CubeMetaSegment
struct literals in compile/test/mod.rs and benches/large_model.rs to
match the new field added to the cubeclient models.

Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
…gment initializers

The previous fix only covered the first two cube definitions in mod.rs.
This adds cube_description: None to all 29 CubeMetaMeasure and
CubeMetaSegment struct literals across NumberCube, WideCube,
MultiTypeCube, StringCube, and SixteenChar test cubes.

Co-authored-by: Pavel Tiunov <pavel.tiunov@gmail.com>
@cursor cursor bot force-pushed the cursor/cube-description-vector-search-0b7c branch from eca938d to d3d5071 Compare April 1, 2026 03:41
@cursor cursor bot deleted the cursor/cube-description-vector-search-0b7c branch April 1, 2026 04:20
@paveltiunov paveltiunov closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client:core Issues relating to the JavaScript client SDK javascript Pull requests that update Javascript code rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants