Skip to content

Conversation

@mongodben
Copy link

@mongodben mongodben commented Aug 28, 2025

Description

Sketch of how I'd improve the evaluation, the evaluability, and include system messages. I'd prefer if someone takes over the PR from me, rather than I work on it through til the end. I annotated the PR with some thoughts to guide reviewing and final implementation.

May want to break up the PR into a couple sub-PRs b/c it's a bit of a grab bag right now.

Feats:

  • Refactor LLM call to be more evaluable
  • Make eval cases arrays for different types (that way easier to add more)
  • Add custom system prompt for specified circumstances

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)

Comment on lines +28 to +30
// TODO: pass the metadata correctly in a strongly typed manner.
// I'm not sure how to do this.
metadata,
Copy link
Author

Choose a reason for hiding this comment

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

pls help with the typescripting here. i couldnt easily figure this out

}
}

export function makeCreateResponse({
Copy link
Author

@mongodben mongodben Aug 28, 2025

Choose a reason for hiding this comment

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

moved LLM call to a helper function which is used both here and in the evals

@@ -1,4 +1,6 @@
export const buildExplainPlanPrompt = ({
const explainPlanSystemPrompt = `TODO:....add custom prompt stuff here`;
Copy link
Author

Choose a reason for hiding this comment

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

add these prompts in future PR.

julian or whoever is working on this can iterate on the prompts and PR them

expected: {
messages: [{ text: c.expected, sources: c.expectedSources || [] }],
},
tags: c.tags ?? [],
Copy link
Author

Choose a reason for hiding this comment

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

tags are useful for looking at the evals as you iterate on them. i recommend inclusion

Comment on lines +142 to 145
// TODO: validate that this works as expected. If not, we must pull the sources out of the stream
const sources = (await result.sources).map((source) => {
return source.id;
});
Copy link
Author

Choose a reason for hiding this comment

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

not sure if this will work as expected. if not you can get the sources from the events in the result.fullStream

Copy link
Author

Choose a reason for hiding this comment

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

renamed to atlas-search.ts to be more general

};
};

export const buildPrompts = {
Copy link
Author

Choose a reason for hiding this comment

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

more extensible by using Record data structure

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant