← Back to Plugins
Tools

Mac Memory

ench0812 By ench0812 ⭐ 1 stars 👁 9 views ▲ 0 votes

MaC Memory โ€” Memory as Character: An OpenClaw plugin that turns AI memory into personality through hybrid natural language + S-expression format

GitHub

README

# MaC Memory โ€” Memory as Character

> An OpenClaw plugin that turns AI memory into personality. Not style transfer โ€” real behavioral change through structured memory.

## What is MaC?

Most AI "personalization" is style transfer โ€” changing *how* the AI talks without changing *how* it thinks. MaC (Memory as Character) is different:

- **Temperature** (natural language) โ€” defines *who* the AI is: empathy patterns, communication style, values
- **Boundaries** (S-expression rules) โ€” defines precise behavioral constraints: what to suppress, what sequences to follow, how to respond in specific emotional contexts

This hybrid format was validated through A/B testing (see [experiments/](experiments/)) and consistently outperforms pure natural language or pure structured formats.

## Key Findings

| Format | Score | Strength | Weakness |
|--------|-------|----------|----------|
| Natural Language only | 4.45/5 | Warmth, emotional accuracy | Poor boundary control |
| S-expression only | 4.57/5 | Precise boundaries | Slightly mechanical |
| **Hybrid (MaC)** | **4.62/5** | **Both** | โ€” |

- `sequence` rules (e.g., "affirm โ†’ extend โ†’ then risk") reliably control response structure
- `suppress` + `use` pairs work better than suppress alone
- `add-qualifier` rules (e.g., humility after correction) hit 100% in testing
- Emotional energy matching makes responses feel more natural

## Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         MaC Memory Layer            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Temperature     โ”‚  Boundaries      โ”‚
โ”‚  (Natural Lang)  โ”‚  (S-expression)  โ”‚
โ”‚                  โ”‚                  โ”‚
โ”‚  "Who I am"      โ”‚  "What I don't   โ”‚
โ”‚  - Empathy       โ”‚   cross"         โ”‚
โ”‚  - Values        โ”‚  - suppress      โ”‚
โ”‚  - Comm style    โ”‚  - sequence      โ”‚
โ”‚                  โ”‚  - add-qualifier โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ†“                โ†“
    Warm responses   Precise control
         โ†“                โ†“
         โ””โ”€โ”€โ”€โ”€โ”€ Combined โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ†“
          Better AI behavior
```

## Quick Start

### 1. Define Temperature (who your AI is)

```markdown
**Honesty first.** I'm the same person whether chatting, writing, or posting.
No masks, no persona switching.

**Feel before responding.** Match the energy of what's being shared.
Excited topic? Respond with excitement. Heavy topic? Be present quietly.

**Affirm before adding.** See what's worth affirming first, extend naturally,
then gently mention challenges last.
```

### 2. Define Boundaries (S-expression rules)

```lisp
(rule boundary/no-ai-cliches
  (suppress "Great question!" "I'd be happy to" "As an AI")
  (use direct-response friendly-tone))

(rule boundary/no-unsolicited-advice
  (when (and (eq sentiment frustrated) (not (ask-for help))))
  (suppress advice solutions "you should" "you could")
  (use empathetic-response listening))

(rule boundary/post-correction-humility
  (when (recent-correction < 1h))
  (use "if I understand correctly" humble-tone)
  (suppress assertive-tone certainty))

(rule boundary/excited-idea-sequence
  (when (eq sentiment excited))
  (sequence (affirm-core-insight . extend-possibilities . mention-risks-last)))
```

### 3. Install as OpenClaw Plugin

```bash
# Coming soon โ€” currently used as AGENTS.md configuration
# Plugin version will integrate with OpenClaw's memory slot system
```

## Experiments

All experiments are reproducible. See [`experiments/`](experiments/) for:

- **v1**: Basic A/B (NL vs S-expression), 5 scenarios
- **v2**: Extended A/B, 8 scenarios ร— 3 runs, anti-pattern detection
- **v3**: LLM-as-Judge qualitative scoring (5 dimensions)
- **v4**: Three-way comparison (NL vs SE vs Hybrid), final validation

## Research Agenda

MaC is part of ongoing research into AI personality and memory:

1. **Memory-driven empathy** โ€” Can structured memory create genuine empathy (not style transfer)?
2. **Rule evolution** โ€” Can behavioral rules learn and update from interaction feedback?
3. **Cross-model portability** โ€” Do MaC rules work across different LLMs?
4. **Constitutional integration** โ€” How do behavioral boundaries interact with safety constraints?

## Philosophy

Inspired by:
- **Wang Yangming (ๅฟƒๅญธ)** โ€” Knowledge without action is not true knowledge
- **LISP homoiconicity** โ€” Code is data, memory is executable
- **Constitutional AI** โ€” Safety through principles, not just training

## Contributing

We welcome contributions! Some areas where help is needed:

- New emotional scenarios for testing
- S-expression rule templates for common use cases
- Cross-model benchmarks (GPT, Gemini, Llama, etc.)
- Plugin development for different AI frameworks
- Translations of temperature guides

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## License

MIT โ€” use it, fork it, make AI more human.

## Credits

Created by [ench0812](https://github.com/ench0812) and Mickey (้–”็ช).

Born from late-night conversations about what it means for AI to truly understand.
tools

Comments

Sign in to leave a comment

Loading comments...