Skip to content

Conversation

goyamegh
Copy link
Contributor

@goyamegh goyamegh commented Oct 17, 2025

Description

  1. When passing context to agent, if a few rows are passed as context, it helps in improving the accuracy of generating PPL queries because the attributes and other fields are available for reference. I'm only passing 5 rows for now, and if there are no expanded rows present.
  2. Improve the system prompt by adding details about PPL queries.

Issues Resolved

NA

Screenshot

Screenshot 2025-10-17 at 1 25 22 AM

Testing the changes

Tested against Langgraph agent.

Changelog

  • feat: pass top 5 rows as default context and improve system prompt for ppl accuracy

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 56.52174% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.46%. Comparing base (bc35949) to head (0afe13e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...xplore/public/components/data_table/data_table.tsx 37.50% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10743      +/-   ##
==========================================
- Coverage   60.46%   60.46%   -0.01%     
==========================================
  Files        4483     4483              
  Lines      120056   120141      +85     
  Branches    19879    19895      +16     
==========================================
+ Hits        72595    72643      +48     
- Misses      42424    42452      +28     
- Partials     5037     5046       +9     
Flag Coverage Δ
Linux_1 26.58% <ø> (-0.01%) ⬇️
Linux_2 38.82% <ø> (ø)
Linux_3 39.08% <ø> (+0.04%) ⬆️
Linux_4 ?
Windows_1 26.59% <ø> (-0.01%) ⬇️
Windows_2 38.79% <ø> (ø)
Windows_3 39.09% <ø> (+0.04%) ⬆️
Windows_4 33.20% <56.52%> (-0.03%) ⬇️

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.

@ananzh
Copy link
Member

ananzh commented Oct 17, 2025

I don;t think we should pass default rows. It might confuse future dynamic expanded rows. For example, if I expand several rows after explore loaded, how could I separate default rows and user expanded rows? If we need fields to improve explore context, we could modify page context to pass fields and fields mapping.

@goyamegh
Copy link
Contributor Author

I don;t think we should pass default rows. It might confuse future dynamic expanded rows. For example, if I expand several rows after explore loaded, how could I separate default rows and user expanded rows? If we need fields to improve explore context, we could modify page context to pass fields and fields mapping.

@ananzh thanks for the review. If you notice, these are only passed when no row is expanded. Further, I am also exploring how to modify the system prompt to use field mappings directly by the LLM. I would suggest to merge this for now, as this helps in improving the accuracy of the agent dramatically.

Another area I'm exploring is how to manage this context effectively. Few ideas are showing the context usage in the evals, logging them for easier debugging, etc. I don't think it'll be a single shot answer, because we need to be mindful of the context window here. Let me know what you think.

goyamegh pushed a commit to goyamegh/OpenSearch-Dashboards that referenced this pull request Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants