/images/logo.jpg

[Project] 2. Synapulse — A Self-Hosted Personal AI Assistant

Synapulse

Overview

Synapulse (Synapse + Pulse) is a self-hosted personal AI assistant that lives in your Discord server. The idea came from OpenClaw — after seeing what it could do, I decided to build the personal assistant I had always wanted, one that is lightweight, transparent, and fully under my control.

Demo

Weather queryWeb search + recommendation
/images/Project%20-%202%20-%20Synapulse/1.%20what%20is%20the%20weather%20today.gif/images/Project%20-%202%20-%20Synapulse/2.%20recommend%20me%20one%20keyboard.gif
Reminder (notify mode)Reminder (prompt mode)
/images/Project%20-%202%20-%20Synapulse/3.%20notify%20me%20drink%20water%20after%201%20minutes..gif/images/Project%20-%202%20-%20Synapulse/4.%20notify%20me%20news%20after%201%20minutes.gif
File creation + send
/images/Project%20-%202%20-%20Synapulse/5.%20create%20a%20file%20contains%20news%20about%20irar%20and%20send%20to%20me..gif

Features

FeatureDescription
AI Chat@mention the bot in Discord to chat, supports multiple AI providers
Tool CallingMulti-round AI tool-call loop (up to 10 rounds), tools auto-discovered at startup, with token compression
Shell ExecutionAI proactively uses shell commands for system queries, calculations, git operations. Cross-platform: PowerShell on Windows, bash on Linux/macOS
Persistent MemoryConversations saved and auto-summarized, cross-session memory
Task ManagementTo-dos with priorities and due dates, AI sees pending tasks proactively
Memo / NotesSave and search personal notes via natural language
RemindersSet reminders with relative time (+5m, +1h) or absolute time. Two modes: notify for passive nudges, prompt for scheduled AI actions (e.g. “tell me the weather in 1 hour”)
File OperationsRead, write, search, and manage local files within allowed paths
Email MonitoringBackground jobs watch Gmail, Outlook, QQ Mail via IMAP, push summaries to Discord
MCP IntegrationConnect to 55+ pre-configured MCP servers (GitHub, Notion, filesystem, databases), on-demand loading to save tokens
Model RotationMulti-endpoint YAML config with tag-based routing, priority, and automatic rate-limit fallback
File & ShellRead/write local files, execute shell commands with safety blacklist and timeout
Notification InteractionReply to any bot message and the AI sees the original content as context
Hot-Reload ConfigEdit job schedules, prompts, MCP servers, model endpoints at runtime without restart

Architecture

Tech Stack

ComponentTechnology
LanguagePython 3.11+
ChannelDiscord (discord.py)
AI ProvidersOpenAI-compatible (GitHub Models, Ollama, custom endpoints)
StorageJSON file-based (one file per data type)
Tool ExtensionMCP (Model Context Protocol) + native auto-discovery
Background JobsAsync cron jobs for email monitoring, reminder checking

Project Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
apps/bot/
├── main.py                    # Entry point
├── config/                    # Settings, prompts, logging
├── core/
   ├── handler.py             # Bootstrap: wire all components via DI
   ├── loader.py              # Auto-discover tools and jobs from folders
   ├── mention.py             # Tool-call loop, memory load/save, summarization
   └── reminder.py            # Background reminder checker
config/                          # Runtime config (models.yaml, mcp.json, jobs.json)
output/                          # Runtime output (logs, data)
├── provider/
   ├── base.py                # OpenAIProvider, AnthropicProvider
   ├── endpoint.py            # EndpointPool: rotation, rate-limit fallback
   └── copilot/auth.py        # GitHub OAuth Device Flow
├── channel/
   └── discord/client.py      # Discord bot integration
├── tool/                      # Native tools (auto-discovered)
   ├── base.py                # BaseTool, OpenAITool, AnthropicTool
   ├── brave_search/          # Web search
   ├── local_files/           # Read/write local files (sandboxed)
   ├── memo/                  # Notes management
   ├── task/                  # Todo list
   ├── reminder/              # Reminders
   ├── weather/               # Weather via OpenWeatherMap
   ├── shell_exec/            # Shell commands (with safety blacklist)
   └── mcp_server/            # Manage MCP connections via chat
├── job/                       # Background jobs (auto-discovered)
   ├── cron.py                # CronJob base with hot-reload
   ├── gmail/                 # Gmail monitoring
   ├── outlook/               # Outlook monitoring
   └── qqmail/                # QQ Mail monitoring
├── mcp/
   └── client.py              # MCPManager: spawn, discover, route
└── memory/
    └── database.py            # JSON file persistence

Core Loop

The tool-call loop in core/mention.py:

[Project] 1. ChromePilot — Control Any Webpage with Natural Language

ChromePilot

Overview

ChromePilot is a Chrome extension that lets you control any webpage using natural language. Type a command like “click the login button” or “fill in my email”, and ChromePilot executes it automatically — clicking, typing, scrolling, and navigating on your behalf.

  • Built with AI (Claude) assistance: 3 hours for the initial prototype, 5 hours to polish into v1.0
  • Current status: v1.0 — functional and usable, with room for further optimization
  • GitHub: GOODDAYDAY/ChromePilot

Features

FeatureDescription
Natural Language ControlType commands like “click the submit button” or “type hello in the search box”
Multi-step AutomationChain complex tasks: “Go to Habitica and complete all my daily tasks”
URL NavigationSay “open YouTube” or “go to google.com” to navigate anywhere
Smart Result ExtractionAsk “translate ‘hello’ on Google Translate” and get the answer in the chat
Persistent Side PanelPanel stays open across tab switches (Chrome Side Panel API)
Multi-provider LLM SupportWorks with OpenAI, Anthropic Claude, GitHub Copilot, Ollama (local), or any OpenAI-compatible API
Debug OverlayVisualize all detected interactive elements with index numbers
Teach ModeRecord user actions and save as demonstrations
Action Preview & ConfirmReview planned actions with visual highlights before execution; provide feedback to re-analyze
Auto-run ModeToggle to skip confirmation and execute actions immediately

Demo

Basic Actions — Click Repetition

Command: “drink water 10 times”

[Cluster] - 3. MySQL Cluster

Overview

  • MySQL is the most widely used relational database in the world.
  • As business grows, a single MySQL instance becomes the bottleneck — both in capacity and reliability.
  • This blog traces the evolution of MySQL high availability: from simple replication to consensus-based clustering.

Evolution History: The Long Road to High Availability

Single Node Era

/images/Cluster%20-%203%20-%20MySQL%20Cluster/01-single-node.svg

The starting point. One MySQL instance handles everything.

[Cluster] - 2. Redis Cluster

Overview

  • The common three cluster modes are Redis(Split Cluster), MySQL(Master-Slave), Kafka(RAFT).
  • This blog will introduce from the single node to the cluster mode of Redis.

Evolution History: From Single Node to Cluster

Single Node Era

  • This is the common monolithic architecture of Redis.

/images/Cluster%20-%202%20-%20Redis%20Cluster/01-evolution-single-Single%20Node%20Era.svg

ProblemsSingle Node
Single point of failure (SPOF)T
Memory limited to single machineT
Write throughput bottleneckT

Master-Slave Replication

  • As to reliability, it is easy to think adding some nodes as Master-Slave.

/images/Cluster%20-%202%20-%20Redis%20Cluster/02-evolution-replication-Master-Slave%20Replication.svg

[Algorithm] 1. Dynamic Programming

Introduction

What is Dynamic Programming?

Dynamic Programming (DP) is often considered one of the most challenging topics in computer science algorithms. However, at its core, it is simply an optimization technique.

The fundamental idea of DP is “Don’t Repeat Yourself.”

If you have already solved a sub-problem, you should save the result (cache it) so that you never have to calculate it again. By trading a little bit of space (to store results) for time (to avoid re-calculation), DP can turn an inefficient exponential algorithm ($O(2^n)$) into a highly efficient linear one ($O(n)$).

[Spring] 2. Analysis of Custom Thread Pools and Thread Reuse in Spring Async Interfaces

Preface

When handling high-concurrency scenarios in Spring applications, proper use of asynchronous programming and thread pool management is crucial. This article provides an in-depth analysis of Spring’s default thread pool, custom thread pools, and thread reuse mechanisms through practical code examples.

Why Use Custom Thread Pools?

When a Spring Boot application starts, it automatically configures a global task executor (TaskExecutor) with the default name applicationTaskExecutor. However, using Spring’s default thread pool directly in production environments is not recommended for the following reasons: