Mstar banner
wbopan wbopan

Mstar

AI community

Description

mstar: Optimizing memory architecture for every LLM task as executable Python code.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

M★: Every Task Deserves Its Own Memory Harness

**Automatically discovering a task-optimized memory harness for each LLM task via reflective code evolution.**

[Wenbo Pan](https://www.wenbo.io) et al.

[![project page](https://img.shields.io/badge/project-page-orange?style=for-the-badge)](https://mstar.wenbo.io) [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue?style=for-the-badge)](https://www.python.org/downloads/) [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-green?style=for-the-badge)](LICENSE) [![Tests](https://img.shields.io/badge/tests-passing-brightgreen?style=for-the-badge)](#quick-start) [![arXiv](https://img.shields.io/badge/arXiv-2604.11811-b31b1b?style=for-the-badge)](https://arxiv.org/abs/2604.11811)

LLM agents need memory to store what they have seen and retrieve it when needed. Everyone hand-designs these systems: pick a vector store, write some retrieval logic, tune the prompts, ship it. This project automates the design process. You provide a benchmark; it evolves a task-specific memory system as executable Python code. The memory it discovers for conversational QA looks nothing like what it discovers for a household robot. Both emerge from the same three simple seeds.

System overview

The idea

A memory system is expressed as a *memory program* — a Python module with three jointly-optimized dimensions: Schema (dataclasses defining what to store and how to query), Logic (`write()`/`read()` backend), and Instruction (prompt constants that steer the task agent). In the code, this is the `KBProgram` (defining `KnowledgeItem`, `Query`, and `KnowledgeBase`); in the paper it is called the *memory program* or *memory harness* — they are the same thing. The evolution loop starts from 3 seeds, evaluates programs on a benchmark (scoring against a static validation set and using a rotating set for