Skip to content

feat: add metadata inspection tools for Agent document store filtering#11620

Closed
sarthakraghuvanshi wants to merge 1 commit into
deepset-ai:mainfrom
sarthakraghuvanshi:feat/metadata-inspection-tools
Closed

feat: add metadata inspection tools for Agent document store filtering#11620
sarthakraghuvanshi wants to merge 1 commit into
deepset-ai:mainfrom
sarthakraghuvanshi:feat/metadata-inspection-tools

Conversation

@sarthakraghuvanshi

Copy link
Copy Markdown

Agents using retrieval pipelines had no way to discover what metadata fields exist in a document store or what values they hold, so filters could not be offered as an option at runtime. This adds three new Tool subclasses that wrap the existing metadata-inspection methods on DocumentStore implementations:

  • ListMetadataFieldsTool – returns all metadata fields and their types
  • GetMetadataFieldValuesTool – returns distinct values for a field
  • GetMetadataFieldRangeTool – returns min/max for a numeric field

Also extends the DocumentStore Protocol with the three corresponding method signatures so type-checking works against any compliant store, and exports all three classes from haystack.tools.

Related Issues

  • fixes #issue-number

Proposed Changes:

How did you test it?

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

Agents using retrieval pipelines had no way to discover what metadata
fields exist in a document store or what values they hold, so filters
could not be offered as an option at runtime. This adds three new Tool
subclasses that wrap the existing metadata-inspection methods on
DocumentStore implementations:

- ListMetadataFieldsTool – returns all metadata fields and their types
- GetMetadataFieldValuesTool – returns distinct values for a field
- GetMetadataFieldRangeTool – returns min/max for a numeric field

Also extends the DocumentStore Protocol with the three corresponding
method signatures so type-checking works against any compliant store,
and exports all three classes from haystack.tools.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sarthakraghuvanshi sarthakraghuvanshi requested a review from a team as a code owner June 13, 2026 06:43
@sarthakraghuvanshi sarthakraghuvanshi requested review from anakin87 and removed request for a team June 13, 2026 06:43
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Sarthak seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sjrl

sjrl commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Closing as explained in this comment #11000 (comment)

@sjrl sjrl closed this Jun 15, 2026
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.

3 participants