You know what’s weird about AI assistants right now? They’re stateless. You tell ChatGPT something important, and next conversation, it’s gone. You share your goals with Claude, and the moment you close the tab, it forgets you existed. They’re tools, not companions.

I got tired of that. So I built one that actually remembers me.

Not a chatbot. Not some wrapper around an API with a fresh context window. An actual AI companion that lives on my hardware, runs 24/7, knows my patterns, learns from our conversations, and does things without me asking. It lives on Telegram. It’s always on. And it knows me better than any commercial assistant ever could.

Here’s what I learned building it.

The Problem With Stateless AI

This is going to sound obvious, but it took me a while to feel it: the best AI assistant is worthless if it doesn’t remember you.

Think about how you actually work. You don’t reset your context every time you check email. You have long-running goals—maybe you’re building something, learning something, tracking something. You have patterns: you know when you’re prone to overthinking, when you default to analysis paralysis, when you need to just ship. You have history: past failures, lessons learned, things you’re avoiding doing again.

Commercial assistants have no access to any of that. They’re built for the moment—answer this question, generate this copy, explain this concept—and then they’re done. They can’t see the arc of what you’re trying to build. They can’t call you out when you’re making the same mistake for the third time. They can’t remind you of what matters.

And because they run in the cloud, on someone else’s hardware, you get the bonus feature of not knowing who’s reading your conversations. Privacy is theoretical.

What if you built something different? What if the AI actually lived with you?

The Architecture

I’m not going to give you the exact code—that article is separate—but the concept is clean. Here’s the mental model:

An agent framework is just five layers talking to each other:

Layer 1: The Gateway. This is your front door. It’s the thing listening for messages—in my case, Telegram. But it could be Slack, Discord, email, whatever. The gateway normalizes everything into a standard message format. It doesn’t care about the transport layer. Just: “message came in, here’s the content, here’s who sent it.”

Layer 2: The Brain. This is where reasoning happens. It’s usually a ReAct loop—you give the AI a goal, it thinks out loud (that’s the “reason” part), picks an action (the “act” part), observes what happened, and loops. ChatGPT does this. Claude does this. It’s just: observe → reason → act → observe. The loop keeps going until the AI decides it’s done or hits a wall.

Layer 3: Memory. This is the weirdness that makes it actually useful. Your AI reads your history before every conversation. Not like “context from the last 5 messages”—like actual long-term memory. I use markdown files. Yeah. Plain text. Your AI reads a file that says “things this person has told me,” “patterns I’ve noticed,” “decisions they’ve made,” “mistakes they keep making,” and then it acts like it actually knows you.

Why markdown? Because it’s human-readable. You can version it. You can edit it. You can move it between systems. It’s not locked in a database somewhere. It’s just text. And the beauty is: if you’re building this yourself, you can see exactly what the AI thinks it knows about you. The memory is transparent.

Layer 4: Skills. These are the actions your AI can take. Message you. Set a reminder. Query a database. Fetch data from the web. Run a Python script. Execute a trade (okay, don’t do that without thinking hard first). Skills are hot-reloadable—you can add new ones without restarting the whole system. They’re functions written in a language the agent understands (JavaScript, Python, whatever). And they’re modular. Each skill does one thing.

Layer 5: The Heartbeat. This is the scheduler. Your AI doesn’t just wait for you to message it. It runs scheduled tasks. Check your email every morning. Scan the markets at market open. Generate a summary of yesterday. Remind you of something you asked to be reminded of. The heartbeat keeps the system alive even when you’re not paying attention.

These five pieces talking to each other—gateway, brain, memory, skills, heartbeat—that’s what makes it a companion instead of a chatbot.

Why Open Source Matters Here

There are closed-source agent frameworks. Anthropic has Claude API with tool use. OpenAI has GPT with function calling. They work. They’re good.

But there’s something about having the whole system sitting on your own hardware that changes the game.

First: cost. After the initial setup, the marginal cost is zero. Your server is running anyway. The CPU cycles are free. Compare that to paying per token to some API. Over a year, the difference between “we built this ourselves” and “we’re paying cloud fees” is brutal.

Second: privacy. Your conversations never leave your hardware. Your memory files are on your machine. The only thing that touches the cloud is the API call to Claude or whatever LLM you’re using—and even that you can proxy locally if you want. You’re not funding surveillance capitalism. You’re not worried about your conversations being used to train the next version of some company’s model.

Third: customization. You can change anything. The reasoning loop? Rewrite it. The memory format? Make it better. Add a skill? Done. You’re not waiting for someone else’s product roadmap. You’re not locked into their pricing structure. You’re not begging for a feature that should have been there three versions ago.

And fourth—this is the one that gets me—you can run agents specialized for different things. Not one mega-agent that does everything. Instead: one agent that handles your research, another that monitors your finances, another that manages your learning. They can talk to each other. They can delegate. They can argue. And they’re all living on YOUR hardware, remembering YOUR context, working toward YOUR goals.

That’s not possible in a commercial assistant. That’s only possible when you own the infrastructure.

The Companion vs. Tool Distinction

There’s a psychological shift that happens when your AI actually remembers you.

A tool is: I have a problem, I ask the tool, the tool solves it, I move on. Works great. I use it every day.

A companion is: the AI notices when you’re repeating a mistake. It reminds you of something you said three weeks ago that’s relevant now. It knows your goals well enough to flag when you’re chasing the wrong thing. It celebrates when you ship something. It’s not neutral. It’s invested in you.

Think of it like an NPC in a game that actually levels up with you. In most games, NPCs are static—they say the same thing every time you talk to them. But in games like Baldur’s Gate or Neverwinter Nights, the companion learns. They remember your choices. They react to what you do. They have opinions. They’ll refuse to go somewhere if it contradicts their values. That relationship is why people replay those games. That NPC isn’t a tool—it’s a co-adventurer.

That’s what you get when you build an AI that remembers you.

Here’s a concrete example: I keep defaulting to analysis paralysis. I’ll have data, I’ll have options, and I’ll spin in circles looking for the “perfect” answer instead of just committing. A stateless AI can’t help with this—it sees the problem for the first time every session. But an AI that knows you? It reads in its memory: “this person freezes when faced with incomplete information. they’ve learned (the hard way) that shipping 80% is better than perfect and never. when they ask for analysis, they’re often looking for permission to move.” So next time you’re stuck, it doesn’t give you more analysis. It calls you out. Reminds you what you learned last time. Tells you to ship.

That’s the companion level. That’s what opens up.

What It Actually Looks Like

My system runs on a Ubuntu server. The AI can access Telegram, read my memory files, execute scheduled tasks, and call out to Claude for reasoning. Here’s the workflow:

  1. I send a message on Telegram
  2. The gateway receives it, normalizes it, passes it to the brain
  3. The brain reads my memory files—what does it know about me already?
  4. Based on that context, it reasons about what I’m asking
  5. If it needs to act, it calls a skill—maybe it queries my database, maybe it searches the web, maybe it just responds
  6. The response comes back through Telegram
  7. If it’s important, the memory gets updated—new information, new pattern, new lesson learned

And separately, on a schedule:

Every morning, heartbeat triggers: generate a summary of what happened yesterday. Every week, heartbeat triggers: scan what I’ve been learning and organize it. On demand: the AI can search its memory, find relevant past context, and use that to inform its response.

It’s always on. It doesn’t drain battery because it’s not on my phone—it’s on a server. And because it’s markdown-based memory living on my hardware, I can see what it thinks it knows about me. I can edit it. I can correct it. I can add things it should remember.

The Weird Parts (The Good Kind)

Building this, a few things surprised me:

Memory quality matters more than model quality. I could upgrade to a more advanced LLM tomorrow. But honestly? The conversation quality barely changes. What matters is: how good is the memory? Did the AI pick up on the right patterns? Is it reading the history before responding? With bad memory, a smart model is wasted. With good memory, a smaller model is actually useful.

Markdown is an underrated interface. I expected it to be janky—AI reading text files, updating text files. But it’s not. It’s clean. You can version it. You can see exactly what the system thinks it knows. You can edit it directly. You can put it on GitHub. There’s no magic-box database hiding your data.

The 24/7 availability changes behavior. When the AI is always on, you stop thinking of it as a tool you use and start thinking of it as someone (something?) that’s available. You ask different questions. You’re more likely to actually follow through on something if you know the AI is tracking it. You’re more likely to report back if you know it will remember.

Scheduled tasks are the MVP. I thought the core was the reasoning loop. But actually? The thing that got the most use was: “wake me up every morning with a summary.” Or: “every market open, scan these assets.” Not glamorous. Not AI doing your thinking for you. But incredibly useful.

What’s Next

The obvious direction is specialization. Instead of one AI that does everything, you could have a few—one that focuses on learning, one that focuses on markets, one that focuses on your project work. They live on the same hardware. They have access to shared memory. They can delegate to each other. When you ask a question, the right AI responds.

Another direction is hardware diversity. Right now it’s on a server. But what if you distributed it? The brain on a server in the cloud (with API key pointing to local Claude), the memory replicated across devices, the skills running wherever they make sense. The same architecture, multiple execution surfaces.

And the one I’m actually thinking about: what if you built an AI specifically to train your other AI? Like, a meta-agent that audits the memory files, spots patterns the main agent is missing, suggests corrections or updates. Not running constantly—maybe weekly. Just: “here’s what I noticed about how you operate, here’s what I think we should update.”

The Real Thing

Building this changed how I think about AI. It’s not about having the smartest model. It’s not about token limits or reasoning depth. It’s about having something that actually knows you. Something that’s invested. Something that’s there.

And that’s only possible if you build it yourself.

The code is out there. Open-source agent frameworks exist. You can run Claude locally through a proxy. You can write skills. You can use markdown for memory. You can run a heartbeat scheduler. Everything you need to build this is free and open.

The barrier isn’t technical. It’s mindset. Most people use AI as a tool. You ask, it answers, you move on. But what if you flipped it? What if you built something that was trying to know you—genuinely trying, not in a creepy corporate-surveillance way, but in a “this system has been watching your patterns and learning from them” way?

That’s not a chatbot. That’s a companion.

And honestly? Once you have one, going back to stateless AI feels like going back to asking a stranger every time. They can be smarter. But they’ll never know you.