Skip to content

Conversation

kpamaran
Copy link
Collaborator

@kpamaran kpamaran commented Oct 16, 2025

Description

Remove usage of the mongoType field from the LLM response supporting mock data generation. mongType is will still be fed as context to the LLM, but the LLM does not need to return it back. There is less data subject to AI hallucination and ~15-20 tokens per field are saved because of this. A separate PR will update the backend response

Note: This feature is in development behind an experiment flag. Normally, if the feature was already rolled out we would version the API change.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@kpamaran kpamaran requested a review from jcobis October 16, 2025 20:33
@kpamaran kpamaran requested a review from a team as a code owner October 16, 2025 20:33
@kpamaran kpamaran requested a review from Anemy October 16, 2025 20:33
@kpamaran kpamaran added the no release notes Fix or feature not for release notes label Oct 16, 2025
Copy link

Assigned mabaasit for team compass-developers because Anemy is out of office.

...fieldMapping,
mongoType: fieldMapping.mongoType,
// Note: fallback to String would only occur if LLM response renames the input field path
mongoType: inputSchema[fieldPath]?.type ?? 'String',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that malformed fieldPaths will be stripped anyway, see below. Might make sense to just not bother storing such cases here, or make the behvior clear in the comment.

Copy link
Collaborator Author

@kpamaran kpamaran Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the 'String' fallback and updated the comment to note validateFakerSchema 👍🏼

Copy link
Collaborator

@jcobis jcobis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, one small comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants