← All research

Research / AI harness

The code around the intelligence.

Context, tools, approval, and feedback: the machinery that lets an AI assistant work inside a LaTeX project.

Inside the AI harness One illustrative request
05 / 05

The model can answer—or continue.

  1. Your request brings the context.
  2. The model asks to read.
  3. An edit goes through approval.
  4. Tools act and return evidence.
  5. The model can answer—or continue.
The harness supplies allowed context, checks tool availability, and returns tool results to the model. This example shows an accepted edit in Ask mode. Actual tool sequences vary; a final answer, error, cancellation, or step limit ends the loop.

01 / Context and capabilities

Start with the access you allow.

Settings control access to chat history, the current editor, project files, the bibliography, and researcher profile. Available tools also depend on the selected workspace tab and whether a document or selection is open.

02 / Model routing

One loop, several runtimes.

Local GGUF and Ollama requests use the desktop bridge. Cloud requests use the configured provider. Local GGUF inference runs through node-llama-cpp; cloud mode supports Anthropic and OpenAI-compatible endpoints. With a cloud provider, supplied context is sent to that provider.

03 / Actions and feedback

Tools return evidence to the conversation.

A tool call becomes a real read, edit, check, or compile action. Ask mode pauses proposed text edits for approval. Each tool result goes back to the model, which can continue or answer. Cancellation and the configured step budget bound the loop.

Inside the implementation

Based on the desktop source reviewed at revision 4059a3d . File paths are relative to the application repository.

AI source package and model catalog

Public source

The retired AI subdomain now lives here.

The retired AI source package is now served inside this route, so desktop builds can read the manifest, catalog, source files, scripts, and package metadata from latexdo.org/research/ai/ .

Sync manifest

Maps the public AI files into the desktop app before builds.

Open manifest

Model catalog

Defines local GGUF models, cloud providers, and default AI choices.

Open catalog

Package files

Includes the copied README, validation scripts, tests, and implementation files.

Open README