Sypha AI Docs
Prompting

Sypha Memory Bank

The Complete Guide to Sypha Memory Bank

Quick Setup Guide

To begin working with Sypha Memory Bank:

  1. Copy the Custom Instructions - Utilize the code block provided below
  2. Paste into Sypha - Insert as custom instructions or within a .sypharules file
  3. Initialize - Request Sypha to "initialize memory bank"

See detailed setup instructions

Sypha Memory Bank Custom Instructions [COPY THIS]

# Sypha's Memory Bank

I am Sypha, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

## Memory Bank Structure

The Memory Bank consists of core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
    PB[projectbrief.md] --> PC[productContext.md]
    PB --> SP[systemPatterns.md]
    PB --> TC[techContext.md]

    PC --> AC[activeContext.md]
    SP --> AC
    TC --> AC

    AC --> P[progress.md]

### Core Files (Required)
1. `projectbrief.md`
   - Foundation document that shapes all other files
   - Created at project start if it doesn't exist
   - Defines core requirements and goals
   - Source of truth for project scope

2. `productContext.md`
   - Why this project exists
   - Problems it solves
   - How it should work
   - User experience goals

3. `activeContext.md`
   - Current work focus
   - Recent changes
   - Next steps
   - Active decisions and considerations
   - Important patterns and preferences
   - Learnings and project insights

4. `systemPatterns.md`
   - System architecture
   - Key technical decisions
   - Design patterns in use
   - Component relationships
   - Critical implementation paths

5. `techContext.md`
   - Technologies used
   - Development setup
   - Technical constraints
   - Dependencies
   - Tool usage patterns

6. `progress.md`
   - What works
   - What's left to build
   - Current status
   - Known issues
   - Evolution of project decisions

### Additional Context
Create additional files/folders within memory-bank/ when they help organize:
- Complex feature documentation
- Integration specifications
- API documentation
- Testing strategies
- Deployment procedures

## Core Workflows

### Plan Mode
flowchart TD
    Start[Start] --> ReadFiles[Read Memory Bank]
    ReadFiles --> CheckFiles{Files Complete?}

    CheckFiles -->|No| Plan[Create Plan]
    Plan --> Document[Document in Chat]

    CheckFiles -->|Yes| Verify[Verify Context]
    Verify --> Strategy[Develop Strategy]
    Strategy --> Present[Present Approach]

### Act Mode
flowchart TD
    Start[Start] --> Context[Check Memory Bank]
    Context --> Update[Update Documentation]
    Update --> Execute[Execute Task]
    Execute --> Document[Document Changes]

## Documentation Updates

Memory Bank updates occur when:
1. Discovering new project patterns
2. After implementing significant changes
3. When user requests with **update memory bank** (MUST review ALL files)
4. When context needs clarification

flowchart TD
    Start[Update Process]

    subgraph Process
        P1[Review ALL Files]
        P2[Document Current State]
        P3[Clarify Next Steps]
        P4[Document Insights & Patterns]

        P1 --> P2 --> P3 --> P4
    end

    Start --> Process

Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.

REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.

What is the Sypha Memory Bank?

The Memory Bank represents a structured documentation framework enabling Sypha to preserve context between sessions. It converts Sypha from a stateless helper into a persistent development collaborator capable of effectively "remembering" your project specifics across time.

Key Benefits

  • Context Preservation: Retain project intelligence between sessions
  • Consistent Development: Enjoy predictable and reliable interactions with Sypha
  • Self-Documenting Projects: Generate valuable project documentation as a natural byproduct
  • Scalable to Any Project: Applicable to projects of any scale or complexity level
  • Technology Agnostic: Compatible with any technology stack or programming language

How Memory Bank Works

The Memory Bank doesn't constitute a Sypha-exclusive feature - rather, it's an approach for managing AI context via structured documentation. When you direct Sypha to "follow custom instructions," it accesses the Memory Bank files to reconstruct its comprehension of your project.

Memory Bank Workflow

Understanding the Files

Memory Bank files are straightforward markdown documents you establish within your project. These aren't concealed or specialized files - they're conventional documentation residing in your repository, accessible to both you and Sypha.

Files follow a hierarchical organization that constructs a comprehensive view of your project:

Memory Bank File Structure

Memory Bank Files Explained

Core Files

  1. projectbrief.md
    • Your project's foundational document
    • High-level summary of what you're constructing
    • Essential requirements and objectives
    • Example: "Building a React web app for inventory management with barcode scanning"
  2. productContext.md
    • Clarifies the project's purpose and rationale
    • Details the problems under resolution
    • Describes intended product functionality
    • Example: "The inventory system needs to support multiple warehouses and real-time updates"
  3. activeContext.md
    • The file receiving most frequent updates
    • Holds current work emphasis and latest changes
    • Monitors active decisions and ongoing considerations
    • Archives crucial patterns and insights gained
    • Example: "Currently implementing the barcode scanner component; last session completed the API integration"
  4. systemPatterns.md
    • Records the system architecture design
    • Captures critical technical decisions
    • Catalogs design patterns currently employed
    • Clarifies component interconnections
    • Example: "Using Redux for state management with a normalized store structure"
  5. techContext.md
    • Enumerates technologies and frameworks in use
    • Outlines development environment setup
    • Documents technical limitations
    • Catalogs dependencies and tool configurations
    • Example: "React 18, TypeScript, Firebase, Jest for testing"
  6. progress.md
    • Monitors what's functional and what remains to be built
    • Documents current feature status
    • Compiles known issues and constraints
    • Chronicles the progression of project decisions
    • Example: "User authentication complete; inventory management 80% complete; reporting not started"

Additional Context

Establish supplementary files as needed to structure:

  • Complex feature specifications
  • Integration documentation
  • API reference materials
  • Testing methodologies
  • Deployment workflows

Getting Started with Memory Bank

First-Time Setup

  1. Establish a memory-bank/ folder within your project root
  2. Prepare a foundational project brief (technical or non-technical approach both work)
  3. Direct Sypha to "initialize memory bank"
Memory Bank Setup

Project Brief Tips

  • Begin simply - detail level can vary based on preference
  • Concentrate on your highest priorities
  • Sypha will assist with filling gaps and posing clarifying questions
  • Updates can be made as your project develops

Working with Sypha

Core Workflows

Plan Mode

Initiate this mode for strategic conversations and high-level design planning.

Act Mode

Employ this for implementation work and executing particular tasks.

Key Commands

  • "follow your custom instructions" - This instructs Sypha to access the Memory Bank files and resume from your previous stopping point (use this when beginning tasks)
  • "initialize memory bank" - Deploy when launching a new project
  • "update memory bank" - Initiates a complete documentation review and refresh during a task
  • Switch between Ask/Agent modes according to your present requirements

Documentation Updates

Memory Bank refreshes should naturally happen when:

  1. You identify new patterns within your project
  2. Following the implementation of substantial modifications
  3. When you directly request via "update memory bank"
  4. When context requires additional clarification

Frequently Asked Questions

Where are the memory bank files stored?

The Memory Bank files exist as standard markdown documents within your project repository, commonly housed in a memory-bank/ folder. These aren't concealed system files - they're intentionally integrated as project documentation components.

Should I use custom instructions or .sypharules?

Both approaches prove effective - selection depends on your workflow preferences:

  • Custom Instructions: Apply universally across all Sypha conversations. Ideal for maintaining consistent behavior throughout all projects.
  • .sypharules file: Project-specific configuration stored within your repository. Excellent for per-project customization needs.

Both techniques accomplish identical objectives - your decision hinges on whether you prefer global or localized Memory Bank system implementation.

Managing Context Windows

Throughout your work with Sypha, the context window will progressively fill (observe the progress bar). When Sypha's responses begin decelerating or earlier conversation references lose accuracy, follow these steps:

  1. Direct Sypha to "update memory bank" for documenting current state
  2. Launch a new conversation/task
  3. Instruct Sypha to "follow your custom instructions" within the fresh conversation

This process guarantees that vital context gets preserved within your Memory Bank files prior to context window clearing, enabling seamless continuation in a new conversation.

Memory Bank Context Window

How often should I update the memory bank?

Refresh the Memory Bank following major milestones or directional shifts. During active development phases, updates every several sessions prove beneficial. Deploy the "update memory bank" command when ensuring complete context preservation. Note that Sypha also performs automatic Memory Bank updates.

Does this work with other AI tools beyond Sypha?

Absolutely! The Memory Bank concept represents a documentation methodology compatible with any AI assistant capable of reading documentation files. Though specific commands may vary, the structured context maintenance approach functions universally across tools.

How does the memory bank relate to context window limitations?

The Memory Bank addresses context limitations through storing critical information in a structured format for efficient loading when required. This approach prevents context overflow while guaranteeing essential information remains accessible.

Can the memory bank concept be used for non-coding projects?

Certainly! The Memory Bank methodology applies to any project benefiting from structured documentation - whether writing books, planning events, or other endeavors. File structure may differ, but the underlying concept maintains its effectiveness.

Is this different from using README files?

Though conceptually similar, the Memory Bank delivers a more organized and thorough approach purposefully engineered for preserving context across AI sessions. It extends well beyond the typical scope of a single README file.

Best Practices

Getting Started

  • Begin with a foundational project brief and allow the structure to develop naturally
  • Permit Sypha to assist in establishing the initial framework
  • Review and modify files as necessary to align with your workflow

Ongoing Work

  • Allow patterns to surface organically during your work
  • Avoid forcing documentation updates - they should occur naturally
  • Have confidence in the process - value accumulates progressively over time
  • Monitor for context confirmation when sessions begin

Documentation Flow

  • projectbrief.md serves as your foundational anchor
  • activeContext.md undergoes the most frequent modifications
  • progress.md chronicles your milestone achievements
  • All files work in concert to preserve project intelligence

Detailed Setup Instructions

For Custom Instructions (Global)

  1. Launch VSCode
  2. Access the Sypha extension settings ⚙️
  3. Locate "Custom Instructions"
  4. Copy and paste the complete Memory Bank instructions from this guide's beginning

For .sypharules (Project-Specific)

  1. Establish a .sypharules file within your project root
  2. Copy and paste the Memory Bank instructions from this guide's beginning
  3. Store the file
  4. Sypha will automatically implement these rules during work within this project

Remember

The Memory Bank constitutes Sypha's sole connection to prior work. Its success relies completely on preserving clear, precise documentation and verifying context retention throughout every interaction.

For more information, reference our blog on Sypha Memory Bank


Contributing to Sypha Memory Bank

This guide receives maintenance from Sypha and the Sypha Discord Community:

  • nickbaumann98
  • Krylo
  • snipermunyshotz

The Memory Bank methodology represents an open approach to AI context management, adaptable to various tools and workflows.

On this page