logancyang_obsidian-copilot/docs/chat-interface.md
wyh cbcf59d5bf
feat(settings): unify Copilot data under one configurable root folder (v4, part 2)
Introduce a single configurable `copilotFolder` root (default `copilot`) that
all six Copilot sub-folders derive from (`${root}/copilot-conversations`,
`/copilot-custom-prompts`, `/system-prompts`, `/skills`, `/memory`,
`/projects`). Retire the three separate sub-folder settings and the
conversation-tag setting; the plugin never moves files — changing the root (or
upgrading with customized sub-folders) reloads consumers to the derived
location, prompts the user once about old→new paths, and leaves existing data
in place.

Core:
- copilotFolder field + v8 migration (seeds root, captures a legacy-upgrade
  flag for pre-versioned installs).
- Pure derived accessors + reuse of the existing subscribe/debounce/reload
  watcher pattern (watchers compare derived paths); custom-command watcher
  added with pure-fetch → generation-check → atomic swap.
- QA privacy: whole-root exclusion expanded from `copilot` to
  `copilot` + active root + all historical roots across all consumer entry
  points; reset/hydrate preserve root history.
- Editable root UI (draft + explicit Apply), change-root ConfirmModal +
  atomic landing + best-effort GC, root validation; conversation tag frozen to
  a constant; skills folder is root-derived (no settings row).
- One-time v3→v4 relocation prompt for customized users.

Docs updated; retired fields kept as dead (no schema break). Tag freeze is
zero-migration (session identity is folder+epoch, never the tag).
2026-07-22 00:49:28 +08:00

6.9 KiB
Raw Permalink Blame History

Chat Interface

The Copilot chat panel is the main way you interact with AI in Obsidian. This guide covers everything about the chat UI: modes, message controls, history, settings, and advanced features like auto-compact.


Chat Modes

Copilot offers four modes. You can switch between them using the mode selector at the top of the chat panel.

Chat

General-purpose conversation. Good for writing, brainstorming, summarizing, or any task where you want to talk to an AI. Your currently open note and selected text are automatically included as context.

Vault QA (Basic)

Ask questions about your vault content. Copilot uses lexical search (keyword matching) to find relevant notes and passes them as context to the AI. No indexing required. Good for quick questions about your notes.

Copilot Plus

The most powerful mode. Requires a Copilot Plus license. Combines Chat and Vault QA with an autonomous agent that can:

  • Search your vault and the web
  • Read and edit notes
  • Remember things across conversations
  • Use a growing set of tools automatically

Projects (alpha)

Focused workspaces with their own context, model, system prompt, and isolated chat history. Useful for keeping separate AI conversations per project. See Projects for details.


Sending Messages

Type your message in the input box at the bottom of the chat panel and press Enter to send (or Shift+Enter to add a new line). You can change the send key in Settings → Basic → Default Send Shortcut.

While the AI is generating a response, a Stop button appears. Click it to interrupt the stream at any time.

Referencing Notes Inline

You can mention specific notes directly in your message using double-bracket syntax:

[[Note Title]]

Copilot adds the note's content to your message as context in the background. This is different from @-mentions — it's typed directly in your message text.

User Message Buttons

Each message you send has action buttons that appear on hover:

  • Edit — Modify your prompt. Press Enter to re-send the edited message to the AI.
  • Copy — Copy the message text to clipboard
  • Delete — Remove this message from the conversation

AI Message Buttons

Each AI response has action buttons:

  • Insert at cursor — Insert the AI's response at your cursor position in the active note
  • Replace at cursor — Replace the selected text in your note with the AI's response
  • Copy — Copy the response to clipboard
  • Regenerate — Ask the AI to generate a new response to the same message
  • Delete — Remove this response from the conversation

Chat History

Autosave

By default, Copilot automatically saves your conversations as markdown files in your vault. Each saved chat appears in the copilot-conversations/ sub-folder of your Copilot folder (by default copilot/copilot-conversations/).

You can turn off autosave in Settings → Basic. When you start a new chat, any unsaved conversation is saved automatically.

Chat File Name Format

The filename template controls how saved chats are named. The default is:

{$topic}@{$date}_{$time}

Where:

  • {$topic} — An AI-generated title (or the first few words of your first message if AI titles are off)
  • {$date} — Date in YYYY-MM-DD format
  • {$time} — Time in HH-MM-SS format

All three variables are required. You can customize the format in Settings → Basic → Conversation note name.

AI-Generated Titles

When Generate AI chat title on save is enabled (default), Copilot asks the AI to generate a short, descriptive title for the conversation when saving. When disabled, the first 10 words of your first message are used instead.

Loading Previous Chats

Click the clock/history icon in the chat panel toolbar to open the Chat History list. You can:

  • Browse previous conversations
  • Click a conversation to load it and continue from where you left off
  • Delete conversations you no longer need

The history list can be sorted by most recent or alphabetically.


Per-Session Settings (Gear Icon)

Click the gear icon inside the chat panel to open per-session settings. These apply only to the current conversation and reset when you start a new chat:

  • System prompt — Override the default system prompt for this session
  • Temperature — Controls randomness (0 = deterministic, 1 = creative)
  • Max tokens — Maximum length of the AI's response

Token Counter

Copilot shows a token count indicator at the bottom of the chat. This estimates how many tokens are being used by your current context. Useful for knowing when you're approaching context limits.


Auto-Compact

When a conversation grows very long, it can exceed the model's context window. Auto-compact automatically summarizes the older portion of the conversation and replaces it with a compressed summary, letting you continue chatting without losing track of what was discussed.

The threshold is configured in Settings → Basic → Auto-compact threshold, which defaults to 128,000 tokens. Valid range: 64,0001,000,000 tokens.

When auto-compact triggers, you'll see a "Compacting" indicator in the chat. The conversation continues normally — older messages are replaced by a summary, so the AI still understands the history even though you can no longer scroll back to see the original messages.


Suggested Prompts

When starting a new chat, Copilot may show suggested prompts based on your active note or previous conversations. You can enable or disable this in Settings → Basic → Show suggested prompts.

Relevant Notes

Copilot can display a list of notes related to your currently active note. This helps surface notes you might want to reference without manually searching. Each note can be opened, dragged in as a wikilink, or sent to the open chat with Add to Chat.

Relevant Notes lives in its own pane. Open it from the command palette: Open Relevant Notes. The pane tracks whichever note you're viewing.

Saving a Chat Manually

If autosave is off, or you want to save mid-conversation, click the Save Chat as Note button above the chat input box. This saves the current conversation to your Copilot conversations folder (copilot-conversations/ under your Copilot folder).


New Chat Behavior

Click the pencil/new chat icon to start a fresh conversation. This:

  1. Saves the current conversation (if autosave is enabled)
  2. Clears the chat window
  3. Resets the context to your currently active note

You can also use the command palette: New Copilot Chat.