Grounded AI
An assistant wired into the same project tools.
The AI assistant is not a detached chatbot. The renderer runs an agent loop that can call LatexDo tools for files, the active editor, compilation, checks, citation lookup, and graph-backed recommendations.
Connected code: src/features/ai/aiTools.ts, src/features/ai/aiAgent.ts, src/features/ai/useAiAgent.ts, src/features/ai/aiClient.ts
Tool Layer
list_files,read_file, andget_active_documentinspect project context.edit_selection,insert_at_cursor, andwrite_filemake controlled editor changes.compileverifies edits and returns compiler diagnostics plus the log tail.run_checks,insert_citation, andrecommend_citationsconnect AI to checkers and the citation graph.
Models
- Cloud mode supports Anthropic Messages and OpenAI-compatible chat completions with native tool calls.
- Ollama runs through Electron main-process IPC and uses Ollama's native tool-calling endpoint.
- Local GGUF models run through
node-llama-cppwith a JSON fallback tool protocol. - The setup catalog includes Qwen2.5 Coder, Qwen3, Llama, Phi, SmolLM, and an inline-completion tier.
Guardrails
AI access is controlled by settings for chat history, current editor, project files, bibliography, and researcher profile. Mutating actions can require approval, the agent has a max-step budget, requests can be aborted, and the prompt tells the model to inspect files before editing and compile after risky changes.