Русский
AI / automation engineer · Saint Petersburg

Pavel Kirikov

I build AI assistants that do real work: Claude agents, RAG over your own data, automation with n8n and Telegram. I learn in public and show what broke and how I fixed it.

What I do

Agents & RAG

Claude API, tool use, prompt caching, pgvector, self-hosted embeddings, hybrid search

Automation

n8n: AI Agent, sub-workflows, schedules, Telegram Bot API 10.x (rich messages, drafts, Mini Apps)

Infrastructure

Linux, Docker, Coolify, Traefik, Postgres 17, monitoring and alerts without heavy dependencies

Approach

One feature at a time, measure before optimising, honest limitations in the docs, audit before shipping

Case study

"Second Brain" — a personal assistant in Telegram

Notes, expenses and budgets, tasks and reminders, a morning digest, memory about the owner, server health. One agent, 23 tools, self-hosted embeddings, monitoring with alerts and a Mini App with charts.

The path of one message

  1. Telegrama text or voice message in a chat topic
  2. n8n"Thinking…" draft, speech-to-text, topic context
  3. AgentClaude picks a tool: 23 SQL tools plus semantic search
  4. Postgresnotes, expenses, tasks, facts, vectors, history
  5. Replytyped out frame by frame, final message with rich formatting
Claude Opusn8nPostgreSQL + pgvectorHugging Face TEITelegram Bot APIPythonDockerCoolifyTraefikGroq WhisperAstro + React

What it looks like

 

Demo with made-up data: replies are typed out exactly like in the bot.

What broke and how I fixed it

Signed reasoning blocks

Claude signs its thinking blocks, while n8n re-evaluated the timestamp in the prompt on every step — the signature stopped matching and a fallback model silently answered. Fix: the time is frozen once per run and reasoning is stripped by a database trigger.

Prompt injection via a forwarded post

Telegram rich markup can embed media by URL — a hidden instruction could exfiltrate data with zero clicks. Fix: my own gateway to the Bot API with a method allow-list and a markup filter.

Free fallback model

It silently replaced the main model and got the delete tools. Removed after a multi-agent audit; the bot now honestly says "no answer".

Monitoring independent of n8n

If the orchestrator dies, the alert must still arrive. A systemd collector writes to the Bot API directly: hysteresis, "resolved" messages, quiet nights.

23agent tools
7topics in one chat
6/6semantic search in the test
1 minmonitoring and reminder step
Contact

Open to projects and offers

Bots and assistants with memory, RAG over your documents, n8n automation of routine work, audits of agents you already have.