File Preview in the Model’s Context Window
As much text of the document as possible is sent to the model as a preview. For small files, this can be the entire document. In chats and Agents with up to 20 total documents, direct files are previewed in context. With more than 20 documents, an Agent retrieves documents through document search instead, while spreadsheets remain attached. Image files are passed to the model as visual content instead of text, so it can analyze them directly.Embedding Search
For files in Knowledge bases and synced agent folders, the model can use an embedding search. During upload, the file is first split into smaller sections (chunks). Each section is then converted into an embedding, a numerical representation that captures the meaning of the content. When a question is asked, the system finds the sections whose content best matches the question. This doesn’t search for specific words, but for sections with similar meaning. Only these relevant parts are sent to the model in context. This enables working with very large documents that exceed the model’s context window.Our Parameters
Embedding Dimension
The vector dimension is 1536.
Chunk Size
Documents are split into sections of 2,000 characters.
Retrieval Parameter (k-value)
Up to 50 chunks are retrieved per query.
FAQ
When does Langdock send a whole file into the model context?
When does Langdock send a whole file into the model context?
Small direct attachments are included in the model context in full whenever possible. Agents preview direct files when they have up to 20 total documents. With more than 20 documents, the Agent uses document search instead, except for spreadsheets.
When does Langdock use semantic search over chunks?
When does Langdock use semantic search over chunks?
Langdock uses semantic search for files in Knowledge bases, synced agent folders, and direct Agent documents when the Agent has more than 20 documents in total. The content is split into searchable chunks, and the most relevant chunks are retrieved for the user’s question. This helps with large document sets, but it also means the model may not see every document or every sentence for every answer.
Why might an answer miss content from a Knowledge base?
Why might an answer miss content from a Knowledge base?
The answer depends on what was retrieved for the specific query. Content can be missed if the question is broad, the relevant wording differs from the user’s phrasing, the file was not processed, permissions block access, or too many sources compete for retrieval. Narrower questions and clearer references to files, topics, or sections usually improve results.
How do knowledge sources affect the context window?
How do knowledge sources affect the context window?
Retrieved knowledge is added to the model’s context for the current request. More knowledge sources, larger retrieved chunks, long chat history, agent instructions, and tool results all compete for the same context window.