continue icon indicating copy to clipboard operation
continue copied to clipboard

Feature Request: Implement Memory Bank for Enhanced Context Management

Open luxixing opened this issue 10 months ago • 2 comments

Validations

  • [x] I believe this is a way to improve. I'll try to join the Continue Discord for questions
  • [x] I'm not able to find an open issue that requests the same enhancement

Problem

Overview

This feature request proposes implementing a Memory Bank system similar to Cline's Memory Bank to enhance Continue's context management capabilities in large projects. The Memory Bank would serve as a structured documentation system that maintains context across sessions, enabling more effective long-term project work.

Motivation

When working on large codebases, Continue (like other AI assistants) faces context limitations that can hinder its effectiveness:

  1. Limited context window for understanding large projects
  2. Difficulty maintaining project context across multiple sessions
  3. Challenges in tracking project evolution and decisions over time
  4. Inefficient context retrieval when working on specific components

A Memory Bank system would address these limitations by providing a structured approach to documentation that both humans and AI can leverage to maintain consistent understanding of a project.

Proposed Solution

Implement a Memory Bank system with the following components:

Core Structure

  1. Project Brief (projectbrief.md): Foundation document defining core requirements and goals
  2. Product Context (productContext.md): Why the project exists, problems it solves, user experience goals
  3. Active Context (activeContext.md): Current work focus, recent changes, next steps
  4. System Patterns (systemPatterns.md): System architecture, key technical decisions, design patterns
  5. Tech Context (techContext.md): Technologies used, development setup, technical constraints
  6. Progress (progress.md): What works, what's left to build, current status, known issues
  7. Project Intelligence (.continuerules): Learning journal capturing important patterns and preferences

Functionality

  1. Initialization: Command to create the initial Memory Bank structure
  2. Context Reading: Automatic reading of relevant Memory Bank files at the start of each session
  3. Context Updates: Commands to update Memory Bank files based on recent work
  4. Context Selection: Smart selection of relevant Memory Bank files based on current task
  5. Integration with existing context providers: Seamless integration with @codebase, @folder, etc.

Technical Implementation

The Memory Bank could be implemented as:

  1. A new context provider (@memorybank) that reads from the structured documentation
  2. A set of commands for initializing and updating the Memory Bank
  3. Integration with the existing chunking and indexing system (see ChunkCodebaseIndex.ts)
  4. Potential integration with the Model Context Protocol for standardized context management

Benefits

  1. Enhanced Context Understanding: Provides Continue with comprehensive project context
  2. Improved Long-term Project Work: Maintains consistent understanding across sessions
  3. Better Documentation: Encourages structured documentation practices
  4. Reduced Context Window Usage: More efficient use of context window by referencing only relevant Memory Bank files
  5. Project Evolution Tracking: Documents project decisions and evolution over time

User Experience

From a user perspective, the workflow would be:

  1. Initialize Memory Bank with a project brief
  2. Continue automatically reads relevant Memory Bank files when starting a session
  3. User can update Memory Bank files as the project evolves
  4. Continue references and updates Memory Bank files as needed during development

Related Work

This feature would build upon Continue's existing context management capabilities:

  • Current chunking system in ChunkCodebaseIndex.ts
  • Context providers like @codebase and @folder
  • Repository map functionality

Next Steps

  1. Design the Memory Bank file structure and schema
  2. Implement the core Memory Bank context provider
  3. Create commands for initializing and updating the Memory Bank
  4. Integrate with existing context providers
  5. Add documentation and examples

Additional Considerations

  • Should Memory Bank files be stored in the project directory or in Continue's configuration directory?
  • How should Memory Bank files be versioned and backed up?
  • What level of automation should be used for updating Memory Bank files?
  • How can we ensure Memory Bank content remains accurate and up-to-date?

References

Solution

No response

luxixing avatar Mar 12 '25 11:03 luxixing

It's possible to use hooks if i link a vector database to enhance context management in lanceDB for example ?

Symfomany avatar Mar 13 '25 06:03 Symfomany

The current system is creating flat files, if there is no plan to put an endpoint to enable the use of external vector databases then really the documentation on the current system should be expanded. Changing the TEI endpoints to enable full fledged rerankers and embedders really has little or no increase in accuracy or any noticeable effect.

having a configuration in the YAML (since that is what all the new features tend to be using) would be great so that it is "pluggable" similar to all other features.

i-belive-in-dog avatar Apr 24 '25 06:04 i-belive-in-dog