Files
manual_slop/conductor/tracks/rag_support_20260308/plan.md
T

3.3 KiB

Implementation Plan: RAG Support

Phase 1: Foundation & Vector Store Integration [checkpoint: dd042d9]

  • Task: Define the RAG architecture and configuration schema. e80cd6b
    • Update src/models.py to include RAGConfig and VectorStoreConfig. e80cd6b
    • Implement configuration loading/saving in AppController. e80cd6b
  • Task: Integrate a local vector store. e80cd6b
    • Add chromadb or qdrant-client to requirements.txt. e80cd6b
    • Create src/rag_engine.py to manage the vector database lifecycle (init, add, search, delete). e80cd6b
  • Task: Implement embedding providers. e80cd6b
    • Implement Gemini embedding wrapper in src/rag_engine.py. e80cd6b
    • Implement local embedding wrapper (e.g., using sentence-transformers) in src/rag_engine.py. e80cd6b
  • Task: Write unit tests for vector store operations and embedding generation. e80cd6b
  • Task: Conductor - User Manual Verification 'Phase 1: Foundation & Vector Store' (Protocol in workflow.md) dd042d9

Phase 2: Indexing & Retrieval Logic [checkpoint: fe0069c]

  • Task: Implement the indexing pipeline. fe0069c
    • Implement file chunking strategies (e.g., character-based, AST-aware) in src/rag_engine.py. fe0069c
    • Create a background indexing task in AppController. fe0069c
    • Implement auto-indexing logic triggered by Context Hub changes. fe0069c
  • Task: Implement the retrieval pipeline. fe0069c
    • Implement similarity search with configurable top-k and threshold. fe0069c
    • Implement "Native Retrieval" logic for Gemini (leveraging ai_client.py). fe0069c
  • Task: Update ai_client.py to support RAG. fe0069c
    • Add a retrieve_context() step to the send() loop. fe0069c
    • Format and inject retrieved fragments into the model's system prompt or context block. fe0069c
  • Task: Write integration tests for the indexing and retrieval flow. fe0069c
  • Task: Conductor - User Manual Verification 'Phase 2: Indexing & Retrieval Logic' (Protocol in workflow.md) fe0069c

Phase 3: GUI Integration & Visualization

  • Task: Implement the RAG Settings panel in src/gui_2.py. f57e2fe
    • Add UI controls for choosing the RAG source, embedding model, and retrieval parameters. f57e2fe
    • Add a "Rebuild Index" button and status progress bar. f57e2fe
  • [~] Task: Implement retrieval visualization in the Discussion history.
    • Display "Retrieved Context" blocks with expandable summaries.
    • Add "Source" buttons to each block that open the file at the specific chunk's location.
  • Task: Implement auto-start/indexing status indicators in the GUI.
  • Task: Write visual regression tests or simulation scripts to verify the RAG UI components.
  • Task: Conductor - User Manual Verification 'Phase 3: GUI Integration & Visualization' (Protocol in workflow.md)

Phase 4: Refinement & Advanced RAG

  • Task: Implement support for external RAG APIs/MCP servers.
    • Create a bridge in src/rag_engine.py to call external RAG tools via the MCP interface.
  • Task: Optimize indexing performance for large projects (e.g., incremental updates, parallel chunking).
  • Task: Perform a final end-to-end verification with a large codebase.
  • Task: Conductor - User Manual Verification 'Phase 4: Refinement & Advanced RAG' (Protocol in workflow.md)