deepset-ai / haystack

:mag: LLM orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
16.58k stars 1.82k forks source link

`MetadataBuilder` #5702

Open sjrl opened 1 year ago

sjrl commented 1 year ago

See the proposal: https://github.com/deepset-ai/haystack/pull/5540 and see feature request for Haystack v1


LLMs clients output strings, but many components expect other object types, and LLMs may produce output in a parsable format that can be directly converted into objects. Output parsers transform these strings into objects of the user’s choosing.

MetadataBuilder. It takes the string replies and inserts them as metadata into the Documents that were originally passed to the LLM. I'm open to renaming this one, since the goal would be to output Documents with inserted metadata.

For example, a PromptNode could be used to summarize a longer doc and the user would like to have the result inserted as metadata for that Document. There it would allow us to easily add category tags, sentiment, summaries (...) to docs that can be utilized later at query time (e.g. to filter down the search space efficiently or utilize the metadata for online retrieval/generation steps)

anakin87 commented 7 months ago

More information on the expected use cases and component I/O can be found here.

In general, it is probably best to focus on developing this component once looping and input lists are handleable by the Pipelines. (Otherwise, we would be going to build a component that is effectively unusable in the Pipelines.)

julian-risch commented 2 months ago

@sjrl We are considering this issue for our next sprint. Is there any new info that will be relevant for the implementation of this component?

anakin87 commented 2 months ago

This is probably relevant: https://www.notion.so/deepsetai/Advanced-Use-Case-Automatic-Metadata-Enrichment-8fdfc56e82434459963beaa7a9dc5069

sjrl commented 2 months ago

Hey @julian-risch thanks for reaching out! No new info on my end. I think the work @davidsbatista did that @anakin87 linked is exactly the type of use case we are thinking about. In general metadata enrichment of files to help with retrieval through filters, embed meta fields, etc. Also possibly for downstream applications (e.g. they want to show a summary along side a retrieved file). I'd be particularly interested in a set up that would allow me to automatically extract things like title, authors, publication date, etc. from PDF files and then save that as metadata with the file.

davidsbatista commented 2 months ago

see https://github.com/deepset-ai/haystack/issues/5700 - it's related/duplicated