[GH-ISSUE #5334] [BUG]: Pinned and Watched Documents without RAG #5028

Open
opened 2026-06-05 14:51:36 -04:00 by yindo · 2 comments
Owner

Originally created by @sugoidesune on GitHub (Apr 2, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5334

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

I would like to always add the entire, current, content of a file as context to my message, without embedding it through RAG.

The content of the file changes, so I can't use any of the static ways like System Prompts.

Currently the watch feature doesn't update when a new thread is created or a new message sent.
I found out that toggling the watch icon, updates the status under Watched documents but doesn't actually update the document. The documentation says that pinned documents are excluded from RAG, but have found that sometimes two versions of the document are added as context. Since pinned documents are excluded from RAG, therefore when watched there is no reason to not always read the latest version of a file from disc.

I suspect the various optimizations for pinned and for watched documents are not playing nicely together, hampering this feature.

Other options I considered that didn't work:
I was hoping to use system prompt variables, but those can't be dynamic (which would be a great feature on its own)

I also do not want to make two API calls each time in agent mode to have it read the file, doubling the cost.

Are there known steps to reproduce?

Pin and Watch a text file.

Originally created by @sugoidesune on GitHub (Apr 2, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5334 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? I would like to always add the entire, current, content of a file as context to my message, without embedding it through RAG. The content of the file changes, so I can't use any of the static ways like System Prompts. Currently the watch feature doesn't update when a new thread is created or a new message sent. I found out that toggling the watch icon, updates the status under `Watched documents` but doesn't actually update the document. The documentation says that pinned documents are excluded from RAG, but have found that sometimes two versions of the document are added as context. Since pinned documents are excluded from RAG, therefore when watched **there is no reason to not always read the latest version of a file from disc.** I suspect the various optimizations for pinned and for watched documents are not playing nicely together, hampering this feature. Other options I considered that didn't work: I was hoping to use system prompt variables, but those can't be dynamic (which would be a great feature on its own) I also do not want to make two API calls each time in agent mode to have it read the file, doubling the cost. ### Are there known steps to reproduce? Pin and Watch a text file.
yindo added the possible bugDesktop labels 2026-06-05 14:51:36 -04:00
Author
Owner

@timothycarambat commented on GitHub (Apr 2, 2026):

Currently the watch feature doesn't update when a new thread is created or a new message sent.
I found out that toggling the watch icon, updates the status under Watched documents but doesn't actually update the document. The documentation says that pinned documents are excluded from RAG, but have found that sometimes two versions of the document are added as context. Since pinned documents are excluded from RAG, therefore when watched there is no reason to not always read the latest version of a file from disc.

To be clear the watched files are not auto updated every time they are referenced. However I think I understand the confusion/bug

Image

To be clear I understand:

  • If i want to watch a document for changes I watch it.
  • I also want the document to be pinned
  • If I send a chat, I should just always be grabbing the full document, not the cached version because why would I want to inject the full text of an old copy.

Potential Solution:

  • Drag and Drop the document into the thread. This will inject the entire document for that thread
  • Downside is you need to drag in the file in every thread you want to "pin" it, but will be current state at time of DnD

Additionally, you could use the file-system-agent skill with just the read-file skill on. Then in agentic chat you can say "Read (location to file) and {rest of prompt}"

This will then use the read skill which will read the file straight off the disk every time. Either way, this is still a bug

<!-- gh-comment-id:4180678779 --> @timothycarambat commented on GitHub (Apr 2, 2026): > Currently the watch feature doesn't update when a new thread is created or a new message sent. I found out that toggling the watch icon, updates the status under Watched documents but doesn't actually update the document. The documentation says that pinned documents are excluded from RAG, but have found that sometimes two versions of the document are added as context. Since pinned documents are excluded from RAG, therefore when watched there is no reason to not always read the latest version of a file from disc. To be clear the watched files are **not** auto updated every time they are referenced. However I think I understand the confusion/bug <img width="1840" height="1106" alt="Image" src="https://github.com/user-attachments/assets/fea1641c-b4d1-4f16-badc-da82307be884" /> To be clear I understand: - If i want to watch a document for changes I `watch` it. - I **also** want the document to be pinned - If I send a chat, I should just always be grabbing the full document, not the cached version because why would I want to inject the full text of an old copy. Potential Solution: - Drag and Drop the document into the thread. This will inject the **entire** document for that thread - Downside is you need to drag in the file in every thread you want to "pin" it, but will be current state at time of DnD Additionally, you could use the `file-system-agent` skill with just the read-file skill on. Then in agentic chat you can say "Read (location to file) and {rest of prompt}" This will then use the read skill which will read the file straight off the disk every time. Either way, this is still a bug
Author
Owner

@sugoidesune commented on GitHub (Apr 2, 2026):

Exactly, I would like the same effect as dragging the file in, but done by default for the selected workspace, and kept up to date.

The problem with using the agent skill is that the file is never added to the context of the chat.
So the agent has to read the file for each message, which doubles the amount of API calls.
User Message -> API LLM requests read file -> file content sent to LLM ->API LLM answers message
Rather painful with Claude Opus and of course slow.

The only other option is for the Agent to write the full content of the file into the chat, at which point im paying the LLM to drag and drop the file :D But it also clutters the chat window unnecessarily.
Being able to add the file content to the chat context directly would be a cool feature either way for more dynamic file situations.
For my rather static use case, it feels painful to pay Claude Opus to perform it.

On a side note while im brainstorming:
would be interesting to be able to use "Agent Skills" programmatically like a macro instead of only making them available through LLM's.
For example "When a new thread is opened fetch current weather and event list as context for the thread"
This way one wouldn't need to pay Claude Opus to tell my PC to get information that we knew we will need anyway.

<!-- gh-comment-id:4180857116 --> @sugoidesune commented on GitHub (Apr 2, 2026): Exactly, I would like the same effect as dragging the file in, but done by default for the selected workspace, and kept up to date. The problem with using the agent skill is that the file is never added to the context of the chat. So the agent has to read the file for each message, which doubles the amount of API calls. `User Message -> API LLM requests read file -> file content sent to LLM ->API LLM answers message` Rather painful with Claude Opus and of course slow. The only other option is for the Agent to write the full content of the file into the chat, at which point im paying the LLM to drag and drop the file :D But it also clutters the chat window unnecessarily. Being able to add the file content to the chat context directly would be a cool feature either way for more dynamic file situations. For my rather static use case, it feels painful to pay Claude Opus to perform it. On a side note while im brainstorming: would be interesting to be able to use "Agent Skills" programmatically like a macro instead of only making them available through LLM's. For example "When a new thread is opened fetch current weather and event list as context for the thread" This way one wouldn't need to pay Claude Opus to tell my PC to get information that we knew we will need anyway.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5028