Building an Autonomous AI Assistant: Part 1 - Architecture

The first post in a series documenting Toni - an autonomous AI assistant running on a Raspberry Pi. Covering architecture, memory systems, and the heartbeat self-improvement mechanism.

# Building an Autonomous AI Assistant: Part 1 - Architecture

This is the first post in a series documenting the development of Toni - an autonomous AI assistant running on a Raspberry Pi. This project explores how to build a self-improving AI system that handles daily tasks, learns from interactions, and maintains long-term context.

What is Toni?

Toni is a personal AI assistant built on Anthropic's Claude Agent SDK. It runs locally on a Raspberry Pi, communicates via Telegram, and has access to the local system. The name has a special meaning - it was given by Lorenz's late father.

The assistant handles several daily tasks: - Interactive conversations via Telegram (text, voice, images, documents) - Scheduled tasks like generating bedtime stories for Isabella - Self-improvement cycles (heartbeats) that autonomously update code and documentation - Long-term memory with semantic search capabilities

Architecture Overview

The system consists of two main services running as systemd units:

### 1. Assistant Bot Service The main bot handles real-time Telegram interactions. Here's the data flow: