The installation and configuration of DiffMem can be divided into the following steps:
environmental preparation
- Cloning the code base:
git clone https://github.com/Growth-Kinetics/DiffMem.git - Install the dependencies:
pip install -r requirements.txt(Includes core dependencies such as gitpython, rank-bm25, etc.)
Key Configuration
The OpenRouter API key needs to be set to invoke the LLM capability:
- Linux/macOS:
export OPENROUTER_API_KEY='your_key' - Windows:
set OPENROUTER_API_KEY='your_key'
Initialize the memory bank
Initialized by Python code:
from src.diffmem import DiffMemory
memory = DiffMemory(
repo_path="/path/to/repo",
user_name="your_name",
api_key="your_key"
)
Git repositories are automatically created when you run it for the first time. It is recommended that you use a separate directory to manage your repositories.
This answer comes from the articleDiffMem: a Git-based versioned memory repository for AI intelligencesThe
































