Skip to content

feat: add agent_with_prompt_builder super-component#440

Closed
marc-mrt wants to merge 6 commits intomainfrom
feature/bui-198-provide-chatpromptbuilder-capability-to-agent-component
Closed

feat: add agent_with_prompt_builder super-component#440
marc-mrt wants to merge 6 commits intomainfrom
feature/bui-198-provide-chatpromptbuilder-capability-to-agent-component

Conversation

@marc-mrt
Copy link
Copy Markdown
Contributor

Related Issues

n/a

Proposed Changes:

As we've seen ChatPromptBuilder be paired with Agent for every use-case on the Platform, a good opportunity for simplification would be a (super-)component that encapsulates the two.
This is an attempts at implementation with a super-component indeed, happy for general feedback on that take.

How did you test it?

Added unit tests, mainly to ensure good behavior of the super-component's input inference based on the template provided.

Notes for the reviewer

I've tried to be exhaustive but there is one thing that I still don't quite get, and would appreciate guidance on: to_dict and from_dict. I saw for example on Haystack's document_preprocessor how they are defined, but not on the multi_file_converter and I'm not sure I understand why on or the other.

Also - as it's my first contribution to Haystack (albeit experimental), any pointers as to unfollowed standards, code quality or misunderstandings of the framework are more than welcome!

Checklist

As we've seen ChatPromptBuilder be paired with Agent for every use-case,
a good opportunity for simplification is a super-component that
encapsulates the two.
@marc-mrt marc-mrt self-assigned this Feb 17, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 17, 2026

Pull Request Test Coverage Report for Build 22147904224

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.8%) to 58.472%

Totals Coverage Status
Change from base Build 22121227772: 0.8%
Covered Lines: 704
Relevant Lines: 1204

💛 - Coveralls

Comment thread haystack_experimental/super_components/agents/agent_with_prompt_builder.py Outdated
Comment thread haystack_experimental/super_components/agents/agent_with_prompt_builder.py Outdated
@sjrl
Copy link
Copy Markdown
Contributor

sjrl commented Feb 17, 2026

A few other comments I have:

  • Do you know if we can easily reuse this super component to make the LLM one? I don't think we've ever done inheritance with a pre-made super component before
  • If we go with the super component approach I think we really need to test the input and output sockets of this component. The Agent component sets many inputs and outputs dynamically that we will still want to be able to use. To test this we should write tests checking the values of the attributes Agent().__haystack_input__ and Agent().__haystack_output__ when we set things like the state_schema={"documents": list[Document]} in the Agent's init and check whether we properly see documents becoming a valid input and valid output of the component.

Comment thread haystack_experimental/super_components/agents/agent_with_prompt_builder.py Outdated
Comment thread haystack_experimental/super_components/agents/agent_with_prompt_builder.py Outdated
…de-chatpromptbuilder-capability-to-agent-component
This commit also comes with a more robust test suite, including a simple
rag-pipeline test to ensure input sockets are properly set in this
context.
@marc-mrt
Copy link
Copy Markdown
Contributor Author

Superseded by deepset-ai/haystack#10638.

@marc-mrt marc-mrt closed this Feb 19, 2026
@marc-mrt marc-mrt deleted the feature/bui-198-provide-chatpromptbuilder-capability-to-agent-component branch February 19, 2026 13:22
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.

3 participants