Overview
Inline LLM discussion anchored to a highlight, with one-click summarization into the highlight’s comment field.
Interaction flow
- User selects text → highlight is created
- A chat panel opens (inline popover or sidebar), anchored to the highlight
- System prompt includes: highlighted text + surrounding paragraph/chapter context
- User discusses freely — “what does this mean?”, “how does this relate to X?”, “compare with Y”
- User clicks “Summarize & Save”
- Final API call asks Claude to distill the conversation into a concise annotation
- Summary is stored as the highlight’s
commentwithcomment_type: ai_synthesized - Full conversation history stored separately (MongoDB
highlight_conversationsor embedded in highlight doc)
Architecture
Frontend (akita-web)
- Chat panel component (React or Astro island)
- Direct Anthropic API calls (
claude-sonnet-4-20250514,/v1/messages) - System prompt template: highlight text + source context + instruction to be analytical
- Conversation state managed client-side (messages array)
- “Summarize & Save” button triggers final summarization call + POST to highlights endpoint
Summarization prompt
- Input: full conversation history
- Output: concise analytical annotation (2-5 sentences)
- Style: insight-focused, not conversational — suitable for re-reading months later
Storage
commentfield on the highlight document (the visible annotation)conversationfield or subcollection (the full discussion, for revisiting)comment_type: ai_synthesizedto distinguish from manual notes
Visual design
- AI-synthesized comments rendered in a distinct style (different background, small icon)
- Expandable: click to reveal the full underlying conversation
Future: corpus-aware mode
- Instead of direct API call, route through Akita MCP server
- Claude can pull in related notes, dossiers, other highlights
- Turns annotation into a research dialogue
- Adds latency — keep as opt-in “deep mode”
Dependencies
- Requires: highlights system (akita-backlog-highlights)
- Requires: Anthropic API key available client-side (or proxied through Akita server)