Some documents matter for only one conversation, such as a contract under review or the log from a single incident. AnythingLLM can attach that kind of file to one chat thread, placing its full text in the model's context instead of embedding it for every thread in the workspace.
An attached file is parsed into text and kept with its thread. It never enters the My Documents library or the workspace's vector database, so other threads cannot retrieve it, and its entire text counts against the model's context window with every message in that thread.
Attaching needs a working chat model, such as an Ollama model connected to an AnythingLLM Docker installation. The workspace's Chat mode reads attachments alongside the model's own knowledge, whereas Query mode answers only from embedded documents and turns away questions in a workspace that has none.
Steps to attach a document to an AnythingLLM chat:
- Create a file named cedar-lantern-dispatch.txt in your text editor containing the following note.
Cedar Lantern dispatch note The Cedar Lantern project uses dispatch code LANTERN-47. Cedar Lantern collections take place on Tuesday at the east reception desk. The approved parcel label is amber triangle. This synthetic note applies only to Cedar Lantern.
A short note with known facts makes the reply easy to check. Any small text document of your own works the same way, with a question about its contents.
- Click the plus button beside Search to start a new workspace.
An existing workspace also works when its chat mode is set to Chat.
- Type Cedar Lantern into the Workspace Name field.

- Click Save in the New Workspace dialog.

- Click the gear icon beside Cedar Lantern in the sidebar.

- Open the Chat Settings tab.

- Select Chat under Chat mode.
The setting saves as soon as it is selected. The default Agent mode hands messages to agent tools when the model supports tool calling, and Query mode replies that the workspace has no relevant information when no document has been embedded, even with a file attached.
- Click + New Thread beneath Cedar Lantern to return to the chat.

- Attach cedar-lantern-dispatch.txt with the + button at the left edge of the message box.
The full text of an attached file is sent to the workspace's chat provider with every message in the thread, and AnythingLLM stores a parsed copy with the thread. Confidential files need the same approval as any other upload.
Dragging the file onto the chat area attaches it in the same way.
- Confirm that the file card above the message box reads Added as context!.
Hovering over the card shows that the file will be used as context for this chat only. A card that reports an error has not been attached.
- Hover over the + button to check the Current Context token count.
A file that would push usage past 80% of the model's context window opens a Context Window Warning instead. Its Embed File option adds the document to the workspace for every thread, and Continue Anyway keeps the file but lets AnythingLLM trim the text to fit, so a smaller file or a model with a larger context window keeps the attachment complete.
- Enter the following question in Send a message.
For Cedar Lantern, what is the dispatch code and collection day? Answer only from the supplied documents and cite the source.
- Click the send arrow to submit the question with the attachment.

- Verify that the reply gives LANTERN-47 as the dispatch code and Tuesday as the collection day.
The wording can vary between runs. A different code or day means the reply did not come from the attached text.
- Click + New Thread beneath Cedar Lantern to open a thread without the attachment.

- Send the same question from the new thread.
The message box in the new thread has no file card and no count above the + button.
- Confirm that the new thread's reply does not give LANTERN-47 or Tuesday.
Without the attachment, Chat mode answers from the model's general knowledge and can invent a code and day, even claiming a source, but no Sources entry appears beneath the reply. The original thread keeps its attachment for follow-up questions.