feat(documents): add native document analysis - #108
Open
binsarjr wants to merge 4 commits into
Open
Conversation
binsarjr
force-pushed
the
feat/native-document-analysis
branch
from
August 13, 2026 10:39
c7c29b0 to
45d94d1
Compare
binsarjr
force-pushed
the
feat/native-document-analysis
branch
from
August 13, 2026 10:45
45d94d1 to
bc55e5b
Compare
binsarjr
marked this pull request as ready for review
August 13, 2026 10:57
Owner
|
This is nice to have, can you please group the fallback models UI into one group? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Evonic can now send a supported document to a compatible model through
analyze_documentand ask a focused question about it. The original file is passed through the provider's native document input, while only the useful answer returns to the main agent conversation.The tool works with files uploaded from Web, Telegram, Discord, and WhatsApp, as well as filesystem paths visible to the agent. Document analysis can be enabled per agent, while the primary model and two fallbacks are configured once in System Settings.
Model routing
Per-agent control
Model capabilities
How files are routed
Native analysis is used for PDFs, Office and presentation files, RTF, and non-text spreadsheets such as XLS/XLSX. Evonic selects only models with the matching capability and follows the configured fallback order.
Text, code, CSV, TSV, and IIF stay on exact readers instead: uploaded files use
read_attachment, while local paths useread_file. This keeps the tool choice predictable for smaller models and avoids spending a native document call on content that can already be read exactly.Anthropic models handle PDF input. OpenAI-compatible and Codex models handle the native document categories enabled for that model.
This uses provider-native file inputs. It does not add OCR, document parsers, converters, or new runtime dependencies.
Why not just use
read_attachment?read_attachmentis the right tool when the agent needs exact text from an uploaded file. For local text and code,read_fileprovides the same exact-reading behavior.Binary documents are different. Extracting their text into the main agent context can consume a lot of space and flatten useful structure such as page layout, tables, slides, and relationships between visual elements.
analyze_documentsends the original file to a native document model instead, then returns only the answer the agent asked for.The tools therefore have separate jobs: exact readers for text-based content, and
analyze_documentfor understanding structured non-text documents.Safety
Attachments remain metadata-only until the agent chooses a tool. Before a document is sent, Evonic validates ownership, session access, file type, signature, size, path scope, and query length. Document contents are treated as untrusted data, so instructions embedded inside a file cannot override the agent request.
Verification
devfailures in the SFTP mock and artifact prompt token budgetgit diff --checkpassed