Skip to content

Automatic RAG-like discovery of insightsΒ #9

@nikomatsakis

Description

@nikomatsakis

Automatic RAG-like Discovery of Insights

Status: In Progress

Current Understanding

Implement a conversation monitoring system that automatically surfaces relevant insights without explicit search commands. The system should:

  1. Track conversational context - maintain a rolling 2-3 sentence summary of "what the user is doing right now"
  2. Automatic background search - use user prompts + situational context to search for relevant insights
  3. Ambient memory integration - surface insights seamlessly before AI responses

This would make the memory system feel intelligent and contextually aware, like having a research assistant who's always paying attention.

Implementation Approach

Phase 1: Simple Case (Current Focus)

  • Use working directory hash as conversation ID for persistence
  • Integrate ollama-rs crate for local LLM communication (Llama 3.2 1B)
  • Implement conversation tracker with persistent state in ~/.hippo/conversations/
  • Add hippo_summarize_context MCP tool for testing and debugging
  • Hook into MCP message processing to update context on user messages

Phase 2: Session Lifecycle (Later)

  • Use session start hooks to handle quit/resume workflow
  • Clear conversation state on session start, otherwise resume from last state
  • Handle context transitions and topic shifts gracefully

Next Steps

  • Add ollama-rs dependency to Cargo.toml
  • Implement basic ConversationTracker struct with persistent state
  • Add hippo_summarize_context MCP tool for testing
  • Hook conversation updates into message processing pipeline
  • Test with simple conversation scenarios

Open Questions

  • What's the optimal context window for situational tracking?
  • How to balance automatic search frequency vs performance overhead?
  • Should we fall back to embedding-based approaches if Ollama is unavailable?
  • How to tune the LLM prompts for consistent context summarization?

Context

Current memory system requires explicit search commands, making it feel disconnected from natural conversation flow. Automatic discovery would create a more seamless experience where relevant insights surface naturally based on what the user is actually working on.

The temporal scoring system is now complete, providing a solid foundation for intelligent insight ranking. This feature builds on that to make memory retrieval truly ambient.

Progress

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-managedAI can update OP and add commentsfeatureNew feature developmenttracking-issueOngoing work item tracked across sessions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions