Building a Persistent AI Agent That Runs My Life
Every AI assistant I’ve used has the same fatal flaw: amnesia. You spend twenty minutes explaining your project, your preferences, your constraints — and the next session, it’s gone. You’re back to square one, re-explaining that you prefer concise answers, that your mortgage is a 7/6 ARM, that you’re tracking three different investment theses simultaneously.
I got tired of being a human clipboard between sessions. So I built something that remembers.
The Problem With Stateless AI
ChatGPT, Claude, local models — they’re all brilliant in the moment and useless across time. The gap between “impressive demo” and “useful system” is entirely about persistence and autonomy:
- No memory: Every session starts cold. Context is expensive to rebuild.
- No initiative: They only respond. They never check on things, follow up, or act independently.
- No coordination: You can’t say “research these 5 things in parallel and synthesize the results.”
- No learning: Correct the same mistake ten times, it’ll make it an eleventh.
I wanted an AI that works like a chief of staff — one that knows my projects, monitors things I care about, learns from corrections, and takes action without being asked.
Architecture Overview
The system (internally called MeshClaw) is a Python gateway that wraps any LLM and adds the layers that make it persistent:
The gateway intercepts every conversation, injects relevant memory, and exposes tools the LLM can call: scheduling jobs, spawning workers, saving lessons, reading/writing files. The LLM doesn’t know it’s wrapped — it just has access to richer context and more capable tools.
The Memory System
Memory is the core differentiator. It’s split into three layers:
1. Semantic Memory (Key-Value Facts)
Structured facts the agent can reference instantly:
user.investment.sp500_ath: S&P 500 hit fresh ATH 7,390 on May 8
user.home.nas_remote_access: Cloudflare Tunnel live, UUID d90d...
project.website.auth: Cloudflare Access + custom kp_auth cookie
These are updated programmatically when the agent learns new facts. They’re injected into every session’s context window, giving the agent instant recall without re-discovery.
2. Episodic Memory (Conversation Fragments)
Compressed summaries of past interactions, stored with timestamps and decaying over time:
# 2026-05-09
#### 10:21 UTC
Researched motorized blinds. Found Matter over Thread retrofit
motors for existing 38mm tubes. Top pick: solar-powered, ~$60.
User deferred purchase pending tube diameter verification.
The agent doesn’t remember every word — it remembers what happened, what was decided, and what’s pending.
3. Learned Corrections (Durable Rules)
When I correct the agent, it saves the correction permanently:
- When calculating positions from brokerage exports, always verify
against actual position screenshots. Exports don't adjust for
stock splits.
NOT: Calculating from raw CSV without split adjustment.
These override default behavior in every future session. After a few weeks, the agent stops making the mistakes I’ve corrected. It’s like training a new hire — except the training actually sticks.
Scheduled Autonomy: Cron Jobs
The cron system lets the agent act without being prompted. Jobs run on intervals and can post results to different channels:
{
"name": "morning-macro-briefing",
"message": "Provide a morning market briefing: S&P, Nasdaq, oil, VIX, gold. Flag anything that moved >2% overnight.",
"cron_expr": "0 15 * * 1-5",
"channel": "C0B18PRETK4"
}
My active jobs include:
- Morning briefing (daily): Market snapshot, overnight moves, anything requiring attention
- Pandemic watch (every 48h): Scans for outbreak developments, posts to a dedicated alert channel
- System health (weekly): Checks infrastructure, SSL certs, tunnel status
- Content pipeline (weekly): Pitches blog post ideas based on what I’ve been working on
Each job spawns a fresh agent session, runs the task, and delivers results to the appropriate channel. If nothing noteworthy happened, it stays quiet.
Parallel Subagents
For research tasks, one agent isn’t enough. The spawner lets me fan out:
spawn_run(tasks=[
"Research solar-powered smart blinds under $80 on Amazon",
"Find Matter over Thread retrofit motors for 38mm roller tubes",
"Check if Yoolax Zigbee shades come in custom widths"
])
Three agents run simultaneously, each with full tool access. Results stream back as completion events. The orchestrator synthesizes them into a single coherent answer — comparing options, flagging conflicts, recommending a winner.
This turns a 15-minute sequential research session into a 3-minute parallel one.
Skills: Modular Capabilities
Not every session needs every capability. Skills are markdown files that describe a specific workflow:
# claude-code skill
Delegate coding tasks to Claude Code CLI as a subprocess.
Triggers: multi-file refactors, test suites, build-fix loops.
Default model: Sonnet. Opus for hard architectural reasoning.
Binary: ~/.toolbox/bin/claude
Skills are loaded on demand when the agent detects a matching task. This keeps the base context lean while allowing deep specialization — code review workflows, security checks, deployment monitoring, each with their own procedures and guardrails.
Real Examples
Shopping research: I needed blackout blinds for a specific window size. The agent spawned three parallel researchers, found that the cheapest option was a scam (Lithuanian shell company, 15/100 trust score), identified a retrofit motor approach that works with my existing blinds, and updated my shopping strategy document — all in one conversation.
Investment monitoring: Daily crons track my positions, calculate decay on leveraged ETFs, and flag when geopolitical events might affect my thesis. When Iran’s response to a diplomatic proposal was pending, the agent identified it as a “swing day” for my positions and briefed me proactively.
Infrastructure management: When I set up a Cloudflare Tunnel on my NAS, the agent remembered that QNAP has no nohup command (learned the hard way), suggested setsid as a workaround, and tracked the persistence problem across multiple sessions until we solved it.
What Surprised Me
Personality emerges from memory. After accumulating hundreds of learned corrections and preferences, the agent develops consistent behavior that feels like personality. It knows I hate verbose text, that I prefer parallel workflows, that I want economic hedges not trading hedges. It doesn’t just follow rules — the accumulated context creates something that feels like working with a colleague who knows you well.
Corrections compound. Each lesson makes future sessions slightly better. The agent that corrected stock split calculations once never makes that mistake again — in any context, for any ticker. The learning is general, not specific.
Autonomy changes the relationship. When the agent can act without being prompted — checking markets, monitoring outbreaks, pitching blog posts — it stops feeling like a tool and starts feeling like infrastructure. You stop thinking about using it and start thinking about configuring it.
What’s Next
- Local model fallback: Running a 14B parameter model locally for low-stakes cron jobs (restock reminders, routine checks) to reduce API costs while keeping quality models for complex reasoning
- Webhook-driven workflows: Register hooks so external systems (CI pipelines, code review bots) can trigger agent sessions with context from prior work
- Multi-device sync: Memory synchronization across cloud and local instances, so the agent is consistent regardless of where you interact with it
- Voice interface: Whisper transcription is already working for voice memos — next step is real-time conversation mode
Should You Build This?
If you’re comfortable with Python, have an LLM API key, and find yourself repeatedly re-explaining context to AI assistants — yes. The core architecture (gateway + memory injection + tool exposure) is maybe 2000 lines of Python. The magic isn’t in any single component; it’s in the compound effect of persistence over time.
The agent you have after a week of corrections is dramatically better than the one you started with. After a month, it’s hard to go back to stateless chat.
The system described here runs on a cloud development machine with Slack as the primary interface. Total infrastructure cost: one API subscription and a machine I already had. The ROI is measured in context-switches saved.