Work with memory
Use memory when you need to memory subsystem — storage, lookup, and security.
Prerequisites
- Access to the project source code
- Familiarity with the files under src/attune/memory/**
Steps
-
Understand the current behavior. Read the entry points to see what memory does today before making changes. The primary functions are:
is_redis_available()insrc/attune/memory/__init__.py— Check if Redis subsystem is available without importing it.create_default_project_memory()insrc/attune/memory/claude_memory.py— Create a default .claude/CLAUDE.md file for a project.parse_redis_url()insrc/attune/memory/config.py— Parse Redis URL into connection parameters.get_redis_config()insrc/attune/memory/config.py— Get Redis configuration from environment variables (legacy dict API).get_redis_memory()insrc/attune/memory/config.py— Create a RedisShortTermMemory instance with environment-based config.
-
Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.
-
Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.
-
Run the related tests. This catches regressions before they reach other developers. Target with
pytest -k "memory".
Key files
src/attune/memory/**
Common modifications
Functions you are most likely to modify:
is_redis_available()insrc/attune/memory/__init__.pycreate_default_project_memory()insrc/attune/memory/claude_memory.pyparse_redis_url()insrc/attune/memory/config.pyget_redis_config()insrc/attune/memory/config.pyget_redis_memory()insrc/attune/memory/config.pycheck_redis_connection()insrc/attune/memory/config.pyget_railway_redis()insrc/attune/memory/config.pyrun_api_server()insrc/attune/memory/control_panel_api.py