# Feature Plan: Second Brain Trace Mode

## 1. Feature Name
Second Brain Trace Mode

## 2. Reason
The user wants to verify whether AI answers actually use Second Brain notes, which documents were searched, and how retrieved knowledge influenced the answer.

## 3. Original User Request
Add a way to see if the AI searched Second Brain, which notes it referenced, whether each note was used in the final answer, and why unused notes were excluded.

## 4. Interpreted User Intent
The user does not want to rely on vague claims that the AI used memory. They want visible grounding evidence and a developer debug trace.

## 5. Scope
- Add a trace mode toggle in the sidebar.
- Add a debug JSON toggle.
- Retrieve relevant Markdown notes from the active Second Brain.
- Inject selected notes into the answer context.
- Append a user-visible 2nd Brain usage section to answers.
- Show searched-but-unused notes and basic grounding metrics.

## 6. Out Of Scope
- Vector database integration
- Full semantic embedding search
- Perfect factual attribution at sentence level
- External observability tools

## 7. Development Direction
Use a low-dependency local Markdown search first. Keep vector search and richer grounding analysis as later expansion.

## 8. Success Criteria
- Users can see whether Second Brain was used.
- Users can see referenced Markdown paths.
- Debug mode exposes retrieval JSON.
- General questions can explicitly show that Second Brain was not used.
