Repository navigation
DEEP_RESEARCH
Status: Partial
Last Updated: 2026-11-13
Audience: Developers and coding agents
Last verified: 2026-11-13 against 29b352d47
Code: src/Martlet.Conversation/Research, src/Martlet.Conversation, src/Martlet.Core/Creations, src/Martlet.Providers
Web research runs in the background and searches for and reads pages. A quick lookup returns an answer. Full and deep research create reports with sources while the conversation continues. This page separates current behavior from dated research and planned work. Research provenance is S51; sources are listed below.
The research job uses the existing background-job scheduler, Thinking pool, tool calling and creation system.
| Piece | Where | What research reuses |
|---|---|---|
| Background jobs |
Martlet.Conversation.BackgroundJobs, Background job API
|
A research kind: limits, cancel, time limit, the talk window chip, delivery of results into the conversation |
| Deep thinking |
ThinkLonger, BackgroundThink, DeepThinkingPlan
|
The model that runs the loop, beside the conversation (cloud, a second Ollama model, a paired computer's Thinking pool role) |
| Function calling and MCP |
TextTools, McpToolService, Martlet.Mcp.Client
|
The reply's research tool; any search MCP server the owner adds |
| Creations | Creations | A report kind keeps the finished report on every computer |
A SearXNG search host role is not implemented. See planned search backends.
- One request carries at most 32 tool rounds
(
BoundedTextInput.HardMaxToolRounds), 16 calls a round and 120,000 characters a tool result (less when the reply's context has less room; a cut result says so). A research loop runs for dozens of steps, so it can't be one long tool conversation. The job drives the loop itself: each step is a fresh, bounded request that carries compressed notes, not the whole history. - A paired computer's Deep thinking route (
deep-thinking-chat) takes no tools (ThinkLonger.HostBounds). Research steps use structured text fields instead of native function calls. This lets the loop run on a Deep thinking model without tool support. - Full and deep jobs have no time limit. A quick lookup has a 10-minute limit. Their search, page, step and byte budgets bound the work, and Cancel stops it.
- Never add conversation latency: the reply only gains one tool definition that is always offered in the same place while research is on, so the request start and prompt cache stay the same. The loop runs on Deep thinking, never on Thinking's model on this PC or a computer that is answering. Search and fetch use asynchronous network calls in the background job.
flowchart LR
A[Reply starts research] --> B[Search with DuckDuckGo]
B --> C[Read up to 3 pages]
C --> D[Send notes and page excerpts to Deep thinking]
D --> E{Search, read, or write report}
E -- search or read --> B
E -- report --> F[Keep report as a creation]
F --> G[Offer result in the conversation]
F --> H[Check cited claims in a quiet background job]
The job can wait until the conversation pauses and a Deep thinking place is free. It reads up to three pages after the first search and up to three pages per later step. Each step sends the model its notes and new page excerpts. The model returns notes, an optional finding, and then a search query, up to three page links, or a report. A quick lookup returns when the watcher finds an answer. Full and deep research can send an early finding while the report continues. The final report is kept as a creation.
| Depth | Model steps | Searches | Pages | Download limit | Time limit | | --- | --- | --- | --- | --- | | Quick | 4 | 3 | 9 | 8,000,000 bytes | 10 minutes | | Full (default) | 40 | 30 | 60 | 25,000,000 bytes | None | | Deep | 80 | 60 | 120 | 50,000,000 bytes | None |
Quick lookups allow two jobs at once. Full and deep research allow one. These limits have no hourly cap. Each request can read up to three new pages. Notes are limited to 15,000 characters.
The following estimates and plans predate the current implementation. They do not describe the current limits above.
These match what open-source research agents use (breadth 3-10 queries a round,
depth 2-5 rounds). One job at a time, a few an hour, like think. A later step
may run 2-4 sub-researchers in parallel, one per sub-question, each with its own
notes, when Deep thinking answers several requests at once (a cloud provider).
Anthropic reports this works far better but costs about 15 times the tokens of a
chat, so it stays opt-in.
The first slice uses one budget, about what a careful person reads to research
something thoroughly (WebResearch.Budget): up to 30 searches, 60 pages and 40
model steps, one job at a time, with no time limit and no hourly limit. Each step
carries the model's own notes (at most 5,000 characters) instead of every page,
so the job fits one message however long it runs.
Answer, look up or research has the details. In short:
-
Levels. The reply's Web research prompt is a ladder: answer from what
Martlet knows, then
search_guide, then a quick look-up (depthquick: 3 searches, 9 pages, 4 steps, alookupjob that goes before long work), then full research (the budget above), then deep research (about twice that), only when the user asks for an in-depth report. -
The watcher (
ResearchWatcher). Each step saysFOUNDonce the pages answer what the user wants. The watcher takes the first answer that cites a page read: a quick look-up ends there, and full or deep research tells the user at once with afindingnotice and goes on for the report. It adds no model request. - Page parts. A long page shows its start and the parts that match what the user wants, not only its start, so an answer deep in a wiki page is found. Pages asked for together are read at once.
-
The source check (
SourceCheck). After the report's result is ready, a quietsourcecheckjob checks cited claims against matching page parts. It checks up to 24 claims, six per request, and can add a Source check section to the kept report. The report does not wait for this job.
Every model request of these parts (research steps, the quick look-up and the
source check) is a Thinking pool request of the research kind. So it runs on
any pool member that does research (Runs on): this PC, a cloud provider or a
paired computer's Thinking pool role. Only searching and reading pages run in
the desktop process, through the address guard. The watcher and the levels are
rules in code and need no model. A SearXNG search host role is not available
yet; see planned search backends.
An open model trained only for this work can be a Thinking pool member. Tongyi-DeepResearch-30B-A3B (Alibaba, open weights, trained with reinforcement learning for long web research) has 30.5 billion parameters, but only about 3.3 billion are active for each token (a mixture of experts). The Hugging Face GGUF files (bartowski) are about 17.6 GB at Q4_0, 16.5 GB at IQ4_XS and 14.1 GB at Q3_K_M, read 2026-10-15. So:
- A host with a 24 GB graphics card holds it at Q4 with room for context.
- A 16 GB card holds Q3, or Q4 with some experts in system memory; because few parameters are active, it stays usable.
- A computer with no suitable card can run it on the processor with 32 GB of memory or more, slowly.
- OpenRouter listed it as a cloud choice when this was researched on 2026-10-15.
It is not needed: the levels work with any Thinking pool model. Its own search-and-read format is not used; it answers Martlet's text steps like any model. Nothing was measured on a real host.
The current code uses DuckDuckGo's unofficial HTML search page through
WebAccess. It needs no key or account, but DuckDuckGo can limit or refuse
automated searches. The IWebSearch interface is the seam for search providers.
The options below are research candidates, not current integrations or available settings. The current feature uses only the built-in DuckDuckGo search.
| Backend | Cost | Why | Research choice |
|---|---|---|---|
| SearXNG on your own host | Free, self-hosted | Meta-search over many engines, JSON API, no key. Queries still go to the selected engines. The proposed search role would run on a Docker or Linux host. |
Proposed default |
Ollama web search (ollama.com/api/web_search, web_fetch) |
Free tier with an Ollama account key | No infrastructure; web_fetch returns clean Markdown |
Candidate |
| Tavily | 1,000 credits a month free | Built for LLM use; can return extracted page content | Candidate |
| Brave Search API | $5 monthly credit (about 1,000 queries), card required | Its own independent index | Candidate |
| Exa | $10 monthly credit | Semantic search with full page contents | Candidate |
| An MCP search server | Depends on the server | Any search tool the owner added on the Tools page | Candidate |
Not used: Bing Search API (retired August 2025), Google Custom Search JSON API (closed to new customers, shuts down 1 January 2027) and Whoogle (breaks as Google blocks it).
Some cloud providers already search and research by themselves. Martlet can hand a job to one instead of running its own loop:
-
OpenAI Deep Research API (
o4-mini-deep-research,o3-deep-researchon Responses withbackground: true): runs the whole job in the cloud and returns a cited report. The job polls it and delivers it the same way. This costs real money per job (dollars for o3), so it needs its own consent. -
OpenAI Responses
web_search, OpenRouteropenrouter:web_search(its older:onlinesuffix is deprecated) and Gemini Search grounding: search billed per call while the model works. These can serve as a search backend for a cloud Deep thinking model.
These are never the default and never chosen silently: the card shows that they cost money, like other paid provider choices.
Every page fetch uses WebAccess in the desktop process:
- Address checks: the fetcher accepts HTTP and HTTPS links without user information. It resolves each connection and connects only to public addresses. The connection handler also checks redirected connections. The handler follows at most four redirects, disables proxies and stores no cookies.
- Bounds: a page can download up to 4,000,000 bytes and keep up to 200,000 characters. Each request has a 15-second timeout. The reader accepts HTML, XHTML and plain text; it does not read PDF pages.
-
Extraction: the reader removes HTML tags and common hidden or navigation
sections, then collapses whitespace. It does not run page scripts or check
robots.txt. - Prompt injection (OWASP LLM01): page text is data. Each step's prompt marks it as untrusted quoted material, and research steps have no tools that act on anything: they can only ask for more searches and reads. The finished report goes into the conversation as a note like any job result, and the reply's normal tool confirmations still apply to anything it does afterwards.
- Web research is on by default, so asking Martlet to look something up is allowed. A reply gets the research tool only when Thinking longer and Web research are on. Its model must support function calls, and a Deep thinking place must be available. The card says what leaves the PC, and the owner can turn the feature off there. Search queries go to DuckDuckGo. Fetched sites receive requests from this PC.
- The desktop log records the job ID, depth, time limit and budget at start. When the job gets a model, the log records its model and host. It records saved report size and source count, not report text.
Paid search backends and provider-native research need separate consent and clear price information before they can be used.
The research_check tool runs a research job with local fixtures. It does not
contact real sites or real AI models. Safe values show the Web research switch,
and its disclosure.
Doctor probes for additional search backends are not implemented.
-
R0: first slice (done):
researchjob kind and theresearch(topic, what_to_find)tool, the loop on Deep thinking with notes carried from step to step, the safe fetcher, a built-in search, thereportcreation kind, the WebResearch switch (on by default) andresearch_check. -
R0.5: levels, watcher and source check (done): the
depthparameter and the answer, look up or research prompt, quick look-ups (lookup), the watcher and its earlyfindingnotice, matching page parts, pages read at once, and the quiet source check that revises the kept report.
-
R1: backends:
IWebSearchproviders for SearXNG (URL or host role), Ollama web search, Tavily, Brave and Exa; fan-out with rank fusion; Doctor probes. -
R2: SearXNG host role:
searchrole on Docker and Linux hosts (searxng/searxngand Redis, JSON on, limiter off, paired-only route), added like other host roles. - R3: parallel sub-researchers when Deep thinking answers several requests at once, with the depth presets above. Their steps feed the same watcher.
- R4: cloud research hand-off: OpenAI Deep Research in background mode, opt-in and paid.
- R5: research without a conversation: start a job from the Creations page or a Research box and follow it in Background tasks.
Accessed 2026-10-06.
- Search APIs: Brave plans, Tavily pricing, Exa pricing, Jina Reader, Kagi API, Google Custom Search JSON API, Bing Search API retirement, Ollama web search, Perplexity Agent API.
- Self-hosted: SearXNG search API.
- Provider-native: OpenAI Responses tools and deep research, Azure OpenAI deep research, OpenRouter web search, Gemini pricing, Anthropic pricing.
- Agent designs: open_deep_research, local-deep-researcher, GPT-Researcher architecture, STORM, dzhng/deep-research, node-DeepResearch, smolagents open Deep Research, Anthropic multi-agent research system, Microsoft Agent Framework.
- Research models (accessed 2026-10-15): Tongyi DeepResearch, its GGUF files, Gemini Deep Research overview.
- Extraction and safety: SmartReader, PdfPig, OWASP LLM prompt injection prevention.
Martlet: download · repository · changelog · issues
These pages come from docs/wiki in the repository. To suggest a change, open an issue or a pull request there.
- Home
- Accounts and households
- Accounts and Household
- Android phones and tablets: what it takes, and the plan
- Martlet's API for other apps and scripts
- App Guides
- App Settings and Updates
- App guides: game and app knowledge from the web
- Architecture
- Bounded PCM playback
- Audio dependency inventory and notices
- Avatar guide: Live2D, VRM and speech animation
- V01a explicit microphone capture
- Chatterbox voice engines
- Cleaning up disk space
- One Martlet on all your computers
- Companion controls and behavior requirements
- Components, jobs and placement (design)
- Live conversation
- Creations
- Decision map: which file owns each decision
- Deep research: web search and long research jobs
- The desktop app: updates, notification area, exiting and appearance
- Linux and macOS desktop companion: research, decision and plan
- Developer Guide
- Dia voice engine
- Diagnostics
- Discord
- Architecture and provider contracts
- Discord
- Memory (P03a/P03b/P03c)
- Singing
- Desktop troubleshooting and local support
- Recognizing people by voice, and Parakeet
- Echo cancellation
- ElevenLabs voice: your cloned voice with tones
- F5 worker and reference-voice foundation
- FAQ
- First Steps
- Game state plan: implementation history
- Glossary: one name for each concept
- GPT-SoVITS voice
- Hosted Thinking: cloud models when Thinking can't run on this PC
- Installation and support
- Installing Martlet
- iOS and iPadOS: what it takes, and the plan
- Repository instructions for coding agents
- Repository knowledge base
- Knowledge base maintenance
- GitHub Wiki mirror
- Linux and Mac
- Listening and Voice ID
- Local model apps
- Lorebooks
- macOS: what it takes, and the plan
- Martlet MCP Server
- MCP in Martlet
- MCP: The app's window
- MCP: Apps, home and memory
- MCP: Characters
- MCP: Diagnostics and logs
- MCP: Computers, network and accounts
- MCP: Other
- MCP: Tool permissions
- MCP pages
- MCP: Server and protocol internals
- MCP: Settings
- MCP: Start here
- MCP: Thinking and models
- MCP: Voice and listening
- Memory
- Messaging apps
- Model catalog: sources, conflicts and design
- Motion host role
- Multiple Computers
- Your Martlet network
- OCR host role
- Share your language models: the OpenAI-compatible endpoint
- Packaging
- Perception worker contracts
- Personality and Characters
- Picture making
- Pictures and Creations
- Picture making host role
- Platforms: what each device can do
- Prerequisites: what Martlet bundles, installs for you, or needs from you
- Privacy and Safety
- Reading the text on your screen
- Wiki source
- Recommendation design: ask three questions, plan for three situations
- Recommended setups: one machine to unlimited budget
- Releasing
- Repository Layout
- Research and provenance ledger
- Resource footprints
- Roadmap
- Watch my screen: screen-aware commentary
- Search engine
- Image and audio models: who sees, who hears, who answers
- Setting Up a Host
- Setup, Windows credentials and local audio
- Sharing with Friends
- Singing
- Smart Home
- Smart home and cameras
- Source Projects
- Talking to Martlet
- Telegram and WhatsApp
- The Character
- Thinking
- Tools and MCP
- Troubleshooting
- Martlet desktop UI design
- User stories and target flows
- Voice activity detection
- Validating changes
- Validation and Testing
- Vision
- Voice latency: from you stopping talking to Martlet's voice
- Voice recognition host role
- Multi-engine voice setup and comparison
- Voices
- The welcome wizard
- XTTS-v2 voice engine