[GH-ISSUE #2952] [FEAT]: Display Backfilled Context #1884

Closed
opened 2026-02-22 18:26:59 -05:00 by yindo · 3 comments
Owner

Originally created by @DangerousBerries on GitHub (Jan 8, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2952

What would you like to see?

It would be great if I could see the context that gets added in through backfilling. Right now, I create and pin important documents to guarantee the LLM follows certain specific details. If I could see the backfilled info in the UI, I would have a better idea of what the LLM is working with, and I wouldn't need to pin everything.

Originally created by @DangerousBerries on GitHub (Jan 8, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2952 ### What would you like to see? It would be great if I could see the context that gets added in through backfilling. Right now, I create and pin important documents to guarantee the LLM follows certain specific details. If I could see the backfilled info in the UI, I would have a better idea of what the LLM is working with, and I wouldn't need to pin everything.
yindo added the enhancementfeature request labels 2026-02-22 18:26:59 -05:00
yindo closed this issue 2026-02-22 18:26:59 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jan 8, 2025):

Backfilled content currently is append as citations - if we use the backfill it winds up as a source on the output chat? Is that not what you are seeing?

@timothycarambat commented on GitHub (Jan 8, 2025): Backfilled content currently is append as citations - if we use the backfill it winds up as a source on the output chat? Is that not what you are seeing?
Author
Owner

@DangerousBerries commented on GitHub (Jan 13, 2025):

Backfilled content currently is append as citations - if we use the backfill it winds up as a source on the output chat? Is that not what you are seeing?

Following our recent conversation, I can't see the backfilled snippets under "Show Citations." Do you see them?

@DangerousBerries commented on GitHub (Jan 13, 2025): > Backfilled content currently is append as citations - if we use the backfill it winds up as a source on the output chat? Is that not what you are seeing? Following our recent conversation, I can't see the backfilled snippets under "Show Citations." Do you see them?
Author
Owner

@timothycarambat commented on GitHub (Jan 14, 2025):

https://github.com/Mintplex-Labs/anything-llm/blob/4d5d8d4dec0e62662c8ec46537038353f45e0e66/server/utils/chats/stream.js#L171-L177

They are in the chat, in the history above. This was an intentional choice to do because what inevitably happens is people open issues about irrelevant documents being in the chat.

https://github.com/Mintplex-Labs/anything-llm/blob/4d5d8d4dec0e62662c8ec46537038353f45e0e66/server/utils/helpers/chat/index.js#L348-L381

We don't show citations when backfilled because they are "inferred" from the above chats citations in the history. If a new document is used in a response it will be cited. Otherwise, we wind up with a citation on a follow-up question like "Thank you" and it is technically irrelevant to the prompt and leads to a worse UX.

The backfilled citations shouldn't show on every answer because that context already exists in the chat window. Again, if a piece of context is novel to a chat history, it is cited. backfilling only applies to existing chat history snippets that are already in the window.

If we did decide to show it then everytime a doc is cited you will wind up with an ever-growing list of documents under every prompt. Backfilling allows us to maximally answer any prompt by always ensuring context that could be relevant is present.

@timothycarambat commented on GitHub (Jan 14, 2025): https://github.com/Mintplex-Labs/anything-llm/blob/4d5d8d4dec0e62662c8ec46537038353f45e0e66/server/utils/chats/stream.js#L171-L177 They are in the chat, in the history above. This was an intentional choice to do because what inevitably happens is people open issues about irrelevant documents being in the chat. https://github.com/Mintplex-Labs/anything-llm/blob/4d5d8d4dec0e62662c8ec46537038353f45e0e66/server/utils/helpers/chat/index.js#L348-L381 We don't show citations when backfilled because they are "inferred" from the above chats citations in the history. If a _new document_ is used in a response it will be cited. Otherwise, we wind up with a citation on a follow-up question like "Thank you" and it is technically irrelevant to the prompt and leads to a worse UX. The backfilled citations shouldn't show on every answer because that context already exists in the chat window. Again, if a piece of context is novel to a chat history, it is cited. backfilling only applies to existing chat history snippets that are already in the window. If we did decide to show it then everytime a doc is cited you will wind up with an ever-growing list of documents under every prompt. Backfilling allows us to maximally answer any prompt by always ensuring context that could be relevant is present.
yindo changed title from [FEAT]: Display Backfilled Context to [GH-ISSUE #2952] [FEAT]: Display Backfilled Context 2026-06-05 14:43:14 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1884