Skip to content

Read web page reads documents - #1095

Open
peerschuett wants to merge 26 commits into
MindWorkAI:mainfrom
peerschuett:read-web-documents-and-intranet-search
Open

peerschuett wants to merge 26 commits into
MindWorkAI:mainfrom
peerschuett:read-web-documents-and-intranet-search

Conversation

@peerschuett

@peerschuett peerschuett commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Read Web Page reads documents

  • PDF, Word, PowerPoint, Excel and OpenDocument files are now read through the runtime (WebDocumentReader.cs). The runtime works out the format from the content.
  • HTMLParser has a new documentDownload hook. Once the headers arrive, any application/* response that isn’t a text format is streamed into a file instead of into memory (HttpContentReader.cs). Images, audio and video are still refused.
  • Downloaded files go into webDocuments/ with random names and no extension. They’re deleted in RetrieveAsync, and files a crash left behind are cleaned up at most once an hour (WebDocumentFiles.cs). The folder is listed in DataBackupContents as temporary.
  • New settings:
    • read_web_page.documentAccess: OFF, INTERNAL_ONLY (the default) or ALL_ADDRESSES.
    • read_web_page.maxDocumentMegabytes: default 50, at most 200.
  • An internal document needs a provider with High confidence. This is checked before the download and raises the chat to High, also for a wiki on a public address.
  • Reading the text has the tool’s timeout on top of the download’s.
  • ReadArbitraryFileData now cuts text at the limit as it streams. Before, it took in the last piece whole and trimmed it afterwards. This affects every caller, including UserFile and PersistentMediaTranscript.
  • Documents embedded in frames, objects or embeds, including PDF.js viewers, become links before the page is cleaned up (EmbeddedDocumentLinks.cs).

Search Confluence reads its best results right away

  • SearchHitReader.cs is new.
    • It reads up to readTopHits results (default 5, at most 10), 4 at a time.
    • The results share maxHitContentCharacters (default 100,000, at most 200,000).
    • They pass the prompt-injection filter in one request, and each result read becomes a source.
  • Results are found in the HTML of the search page. Nothing is read when Read Web Page is switched off.
  • The instructions now point the model to wiki attachments.

Related proposal or issue

Wiki

What changes for users

  • Read Web Page can now read documents: PDF, Word (DOCX), PowerPoint (PPTX), Excel and other spreadsheets, and OpenDocument files. By default, it reads them only from the Confluence wiki and from the allowed private hosts, and only with a provider of High confidence. Once the AI has read an internal document, the chat keeps it away from less trusted providers.
  • Pages which show a document in an embedded viewer, such as a PDF on an intranet page, now give the AI a link to that document.
  • Search Confluence now reads its best results right away, wiki pages and attachments alike, and points the AI to wiki attachments. Fewer tool calls are needed per question.

New settings and configuration keys

  • read_web_page.documentAccess: OFF, INTERNAL_ONLY (default), ALL_ADDRESSES. From where the AI may read documents.
  • read_web_page.maxDocumentMegabytes: integer string, default 50, at most 200. The largest document the AI may download. It is stored in a temporary file while its text is read and deleted right after.
  • search_confluence.readTopHits: integer string from 0 to 10, default 5. How many of the best results the search reads right away; 0 switches it off. Nothing is read when Read Web Page is switched off.
  • search_confluence.maxHitContentCharacters: integer string, default 100,000, at most 200,000. How many characters of content the results read along bring together.
  • Changed meaning: read_web_page.timeoutSeconds now also limits reading the text of a document, on top of the download. Reading the results of search_confluence takes at most twice search_confluence.timeoutSeconds in total.
  • Changed default: read_web_page.maxContentCharacters now defaults to 80,000 characters (before: 30,000), at most 100,000. A value set by the user or the organization stays as it is.

All keys can be locked or preset by organizations through DataTools.LockedToolSettings and DataTools.DefaultToolSettings.

New folder in the data directory

  • webDocuments/ holds documents only while their text is read. It is not part of data backups.

Wiki pages concerned (to be confirmed by the maintainers)

  • User guide (EN/DE): the page on tools, sections Read Web Page and Search Confluence.
  • Enterprise IT: the page on configuring tool settings / configuration plugins.

How did you test it?

  • ran dotnet run verify
  • ran the app locally:
    • read PDFs from interal pages (wiki and intranet)
    • made a confluence search
    • tried to read PDFs from external websites

Required statements

  • Review: I have reviewed every change in this pull request and can explain it when asked.
  • License: I license my contribution in this pull request, including all commits I add to it later, under the MIT License, and I agree that it is distributed as part of MindWork AI Studio under the project license or under the MIT License.
  • Right to contribute: The contribution is my own work, or I have permission to submit it, including the consent of my employer or client where needed. To the best of my knowledge, it does not infringe the rights of others, and AI-generated parts do not reproduce third-party code under incompatible terms.
  • Changes by maintainers: I understand that the maintainers will change this pull request to fit the product, and that they may close it.

Credits (optional)

  • Credit me with my GitHub username only.
  • Do not credit me.

Peer Hogeterp and others added 15 commits October 20, 2026 12:03
Intranet pages often show forms and guidelines as a PDF in a frame,
object, or embed. The extraction removed these elements, so the model
never learned of the document and, with free address choice off, could
not open it. Elements whose media type or address names a document
now become a link first; viewers such as PDF.js lead to the document
they show. Every other frame is still removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime reads documents from disk only, so a document from the web
has to land in a file while its text is extracted. The files get random
names without extension, so the runtime decides the format by content,
and live in webDocuments/ in the data folder, listed as temporary files
for backups. Leftovers older than an hour are deleted before downloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReadArbitraryFileData takes an optional character limit and marks a
result which was cut there. The rest of the file is still read but
thrown away, because the runtime reports what its prompt-injection
filter removed only at the end, and the user has to hear of it. A
long document from the web thus never sits in memory as a whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A caller may now allow documents such as PDFs, Office files, and
spreadsheets for chosen addresses through WebPageRetrievalOptions.
Documents. Such a response streams into a file in webDocuments/ with
a size limit; the runtime reads it, recognizes the format by content,
and filters prompt injections; the file is deleted afterwards in every
case. Web search and the ReadWebContent component pass no document
options and keep refusing binary content as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read Web Page now reads PDF, Word, PowerPoint, Excel, and OpenDocument
files. The new setting documentAccess decides from where: OFF, only
from the wiki and the allowed private hosts (INTERNAL_ONLY, the
default), or from every address. maxDocumentMegabytes caps the
download (default 50, at most 200). Internal documents require a
High-confidence provider and raise the chat to High, also for a wiki
on a public address. Long documents are cut at maxContentCharacters
and reported as partial. The instructions tell the model where
documents can be read, without naming addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The instructions of search_confluence now tell the model that much of
the wiki's knowledge lies in attachments such as PDFs, typically below
/download/attachments/, and that read_web_page opens them. Attachments
are within the wiki, so the default document access reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools.md explains the embedded-document links, where documents are read
from, the confidence rules, the temporary file, format detection, and
the character limit. The changelog for v26.10.1 announces documents in
Read Web Page, the size limit, their organization-wide management, and
the improvements for embedded viewers and wiki attachments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
search_intranet searches a SharePoint Server intranet through its
search REST API (/_api/search/query) with the operating system's
sign-in, using the same page reader as Read Web Page, so every request
and redirect has to stay within the configured intranet. The model
passes plain words; the tool strips the characters of the query
language. It understands Atom XML and both JSON forms of the answer,
returns title, link, excerpt, file type, date, and site per hit, and
filters them for prompt injections. Hits are internal: the tool needs a
High-confidence provider, raises the chat to High, and restricts the
chat at the level of internal pages, under the new origin INTRANET.
Selecting it also selects Read Web Page, which opens the hits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The intranet of search_intranet now counts as a service configured in
AI Studio: a restricted chat may still read its pages and documents,
an address the model chose must stay within the intranet on every
redirect, and its content is internal whatever its address, so its
documents are read with the default document access. The instructions
name the intranet among the configured pages. The existing methods
take the intranet as an optional parameter, which keeps their callers
and tests unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools.md describes the search through the SharePoint REST API, how the
query and the answer are handled, when the chat is restricted, and how
Read Web Page treats the configured intranet. plugin.lua lists the new
tool and its settings for organizations, and the changelog for v26.10.1
announces the tool and its organization-wide management.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SharePoint names its libraries and files with spaces, and Uri.ToString()
turns %20 back into a space. A hit such as .../Shared Documents/x.pdf
then ended at the first space for WebAddresses.Find, did not count as
given to the model, and Read Web Page refused to open it while the free
address choice was off. Hits, the search address, and embedded-document
links now use AbsoluteUri.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chat may call 15 tools per answer, and a search followed by one
read_web_page call per hit used them up before the model answered. The
new SearchHitReader reads the best hits of a search, up to four at a
time, under the request options of the search itself, so requests and
redirects stay within the site. Documents follow the settings of Read
Web Page. The hits share one character budget, are filtered for prompt
injections in one request, and a hit which cannot be read costs that
hit only.

search_intranet reads its best hits within the intranet with it. New
settings: readTopHits (default 3, at most 10, 0 switches it off) and
maxHitContentCharacters (default 30000, at most 100000). FakeRuntime
learns the batch route of the prompt-injection filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
search_confluence finds the result links in the HTML of the search
page, by the class search-result-link of their title links or, where a
version marks none, by the first link of each search-result element.
Only links within the wiki count, never the search or login page. The
best of them are read with SearchHitReader and returned in read_hits,
with the same settings as the intranet search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools.md explains why and how both searches read their best hits,
plugin.lua documents readTopHits and maxHitContentCharacters for both
tools, and the changelog for v26.10.1 announces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peerschuett
peerschuett requested review from a team as code owners October 20, 2026 13:48
@peerschuett
peerschuett marked this pull request as draft October 20, 2026 13:48
@peerschuett peerschuett changed the title Read web documents and intranet search Read web page reads documents Nov 3, 2026
Peer Hogeterp added 8 commits November 3, 2026 09:58
…d-intranet-search

# Conflicts:
#	app/MindWork AI Studio/Assistants/I18N/allTexts.lua
#	app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua
#	app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua
#	app/MindWork AI Studio/Settings/DataModel/OutboundDataOrigin.cs
#	app/MindWork AI Studio/Settings/DataModel/OutboundDataRequirementExtensions.cs
#	app/MindWork AI Studio/Tools/ToolCallingSystem/ToolCallingImplementations/ConfluenceSearchTool.cs
#	app/MindWork AI Studio/Tools/ToolCallingSystem/ToolCallingImplementations/ReadWebPageTool.cs
#	app/MindWork AI Studio/wwwroot/changelog/v26.10.1.md
#	documentation/Tools.md
The intranet search is out of scope for this branch. Read Web Page
therefore no longer knows a configured intranet: only the wiki and
private addresses count as internal, only the wiki confines redirects
to itself, and the instructions, refusals, and setting texts name the
wiki and the allowed private hosts only. An intranet on a private
address is still reached through the allowed private hosts, and its
documents still count as internal there.
The intranet search is out of scope for this branch. This removes the
tool, its registration and ID, the outbound data origin INTRANET with
its blocked message, and the rule which brought Read Web Page along
with it. SearchHitReader stays: Search Confluence reads its best hits
with it. INTRANET was the last member of OutboundDataOrigin, so no
other value moves.
Tools.md describes reading the best hits for Search Confluence only and
no longer lists the intranet among the sources and configured services
of the outbound data restrictions. plugin.lua drops the settings, tool
IDs, and examples of search_intranet, and the documents of read_web_page
come from the wiki and the allowed private hosts. The changelog for
v26.10.1 drops both Search Intranet entries and names the same sources
for documents.
Search Confluence read three hits sharing 30,000 characters, while web
search reads five pages sharing 100,000. Both now behave alike:
readTopHits defaults to 5 and maxHitContentCharacters to 100,000, at
most 200,000, the limit of web search. readTopHits stays at most 10,
the results of one search page. A test keeps both defaults equal to
those of web search.
The localization run drops the texts of the Search Intranet tool and
translates the changed texts of Read Web Page. The German entries use
the established wording: "zulässige private Hosts", the confidence
level "Hoch", and the text of main for the internal-page setting,
whose English text is the one of main again.
Peer Hogeterp added 2 commits November 11, 2026 08:43
Main brought its own character limit for reading files through the
runtime. The merge keeps main's interface (IsShortened, maxCharacters
before the token, a limit below 1 is refused) and this branch's way of
cutting, which never reports a file ending exactly at the limit as
shortened.

Also adapts ReadWebPageTool to main's renames: OutboundDataRestriction
names come from the Name property, and the document access setting is
read with TryParseName.
@peerschuett
peerschuett marked this pull request as ready for review November 11, 2026 08:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant