Skip to content

Commit d9370e0

Browse files
author
Tim Sinaeve
committed
docs: update functional and technical manuals for agent tool selection and RAG logging
1 parent 1813e0f commit d9370e0

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

FUNCTIONAL_MANUAL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,16 @@ Beyond searching your entire workspace, you can explicitly "pin" documents to a
183183

184184
Agent Mode transforms the chat assistant from a passive information retriever into an active workspace participant.
185185

186-
- **Tool Calling**: When Agent Mode is enabled, the AI can proactively use tools to interact with your workspace. This includes:
186+
- **Tool Calling**: When Agent Mode is enabled, the AI can proactively use tools to interact with your workspace. You can **enable or disable specific tools** in the **AI Chat** settings to control exactly what the agent can do. Available capabilities include:
187187
- **Document Management**: Creating new documents or folders, renaming existing ones, and moving files between directories.
188188
- **Content Refactoring**: Reading document contents and performing bulk edits or restructurings based on your instructions.
189189
- **Script Execution**: Running Python, Shell, or PowerShell scripts to process data, generate files, or automate complex workflows.
190190
- **Action Approval Gate**: For security, all sensitive actions (like deleting documents or running scripts) can be configured to require your manual approval. A glassmorphic modal will appear showing exactly what the AI intends to do, including any script code or move parameters, allowing you to approve or deny the request before it executes.
191+
- **Real-Time Execution Logs**: To provide transparency, DocForge streams detailed logs of the RAG search and tool execution process directly into the chat. You can see when the AI is searching the index, which files it found, and the exact status of tool calls as they happen.
191192
- **Thoughtful Execution**: The agent can perform multi-step tasks—for example, it can list all documents in a folder, search for specific patterns, and then create a summary document based on its findings—all in a single conversation turn.
192193
- **Deep Integration**: The agent has direct access to the same document hooks as the GUI, ensuring that its actions are consistent with the application's state and history.
193194

195+
194196
#### Python Execution Panel
195197

196198
DocForge includes an embedded Python runner that integrates with the editor when you're working on Python content.

TECHNICAL_MANUAL.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ DocForge treats shell and PowerShell automation as first-class workflows that sp
115115
- **Main-process runner (`electron/scriptRunner.ts`):** Persists run metadata, writes temporary script files, and spawns the resolved executable. Test mode leverages `scriptArgs.ts` to compute syntax-only flags (for example, Bash `-n`, or a PowerShell `ScriptBlock` parser) and gracefully fails when an interpreter cannot support syntax checks. Streams from stdout/stderr are recorded to `script_execution_logs` and broadcast back to the renderer.
116116
- **Defaults management:** Global defaults live in the `settings` table (`shellDefaults`, `powershellDefaults`) and are edited through `SettingsView.tsx`. When a run starts, the runner merges these defaults with per-document overrides so teams can set organization-wide variables while allowing individual scripts to customize their environment safely.
117117

118-
### LLM Service (`services/llmService.ts`)
118+
### LLM Service (`services/llmService.ts`) & RAG Orchestrator
119+
120+
This module handles all communication with the external Large Language Model and coordinates the "Chat with Workspace" workflow.
121+
122+
- **API Integration**: It constructs the appropriate API request body based on the configured API type (Ollama or OpenAI-compatible). It includes robust error handling to manage connection failures or non-OK responses from the provider.
123+
- **Agentic Tool Filtering**: When Agent Mode is active, the service filters the available tools based on the `chatEnabledTools` user setting before sending them to the LLM. This ensures the AI only attempts actions that the user has explicitly permitted.
124+
- **Log Propagation (`onLog`)**: The `ragService` includes a callback mechanism that streams diagnostic logs (e.g., search distance, tool execution status, history trimming) back to the UI. This provides users with visibility into the "thinking" and "acting" phases of the assistant.
125+
- **Context Management**: To maintain efficiency and accuracy, the service automatically trims conversation history to the last 10 turns and includes pinned documents directly in the system prompt context.
126+
- **Clipboard Intelligence**: Clipboard imports invoke `llmService.generateTitle()` when a provider is online, allowing the renderer to assign meaningful titles to new documents automatically.
119127

120-
This module handles all communication with the external Large Language Model. It is largely unchanged by the database migration.
121-
- It constructs the appropriate API request body based on the configured API type (Ollama or OpenAI-compatible).
122-
- It includes robust error handling to manage connection failures or non-OK responses from the provider.
123-
- Clipboard imports invoke `llmService.generateTitle()` when a provider is online, allowing the renderer to assign meaningful titles to new documents automatically.
124128

125129
### Component Breakdown
126130

0 commit comments

Comments
 (0)