Skip to content

Implement persistent memory and enriched user context for agent#608

Merged
asim merged 2 commits into
mainfrom
claude/add-wallet-transfers-74PHC
Jun 5, 2026
Merged

Implement persistent memory and enriched user context for agent#608
asim merged 2 commits into
mainfrom
claude/add-wallet-transfers-74PHC

Conversation

@asim
Copy link
Copy Markdown
Member

@asim asim commented Jun 5, 2026

No description provided.

claude added 2 commits June 5, 2026 21:10
Memory package (memory/memory.go):
Per-user key-value store that persists across sessions. The agent
remembers preferences, interests, and facts the user shares.
Stored in memory.json, capped at 50 entries per user.

API: Set, Get, All, Delete, Clear, ForContext (formatted for
prompt injection). Cleared on account deletion.

Memory extraction:
After each agent query, extractMemory checks if the user's prompt
contains something to remember (triggered by keywords like
"remember", "I like", "I prefer", "I live in"). If detected, a
background LLM call (BackgroundModel) extracts a key-value pair
and saves it. Next query, the agent sees it in its context.

Enriched user context:
The agent's synthesis prompt now includes:
- Unread mail count
- Wallet balance
- Market prices (BTC, ETH, SOL, GOLD, OIL with 24h change)
- All saved memories

markets.TopMovers(n) returns a compact string of top tracked
assets with prices and 24h changes.

The agent introduces itself as "Micro, a personal AI assistant"
and has genuine awareness of the user's state — mail, money,
markets, and what they've told it to remember.

https://claude.ai/code/session_01GRGLA9yj7BpqKiyi6xFwnm
@asim asim merged commit 2b48890 into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants