HKUDS / LightRAG

"LightRAG: Simple and Fast Retrieval-Augmented Generation"
https://arxiv.org/abs/2410.05779
MIT License
10.02k stars 1.25k forks source link

Referencing source documents #137

Closed yusufyesil closed 1 month ago

yusufyesil commented 1 month ago

Is it possible to reference source documents that are used in retrieval?

aiproductguy commented 1 month ago

I added a system prompt and instructions to do this exact thing in the streamlit app, but it needs to index additional data and additional prompt engineering.

Let me know what you think.

Demo: https://lightrag.streamlit.app PR: https://github.com/HKUDS/LightRAG/pull/139

yusufyesil commented 1 month ago

That's great but not what I looking for, I need to give references to which sources used in response.

aiproductguy commented 1 month ago

Please share what you find. I am thinking of chaining another agent with source-only kg to verify context and sources. LightRAG's current data model looks like an elegant start, but not yet optimized for a domain-specific problem yet.

Dormiveglia-elf commented 1 month ago

Yes, it is possible for sure. I am trying on that, and trying to visualize the query related relations when do the query.

yusufyesil commented 1 month ago

Great, I am looking for a workaround to list source docs. Thank you.

Tint0ri commented 1 month ago

This is a important feature for retrieval system. According to the source code, only text was upserted into vdb, no relative metadata. For nano_vectordb, upsert does support content with metadata. for query, if content_only is false, a list of Document should be return instead of content only.