惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
Hugging Face - Blog
Hugging Face - Blog
D
Docker
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 【当耐特】
G
Google Developers Blog
Simon Willison's Weblog
Simon Willison's Weblog
Recorded Future
Recorded Future
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Palo Alto Networks Blog
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Security Latest
Security Latest
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
Y
Y Combinator Blog
K
Kaspersky official blog
F
Full Disclosure
L
LINUX DO - 最新话题
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Latest news
Latest news
N
News and Events Feed by Topic
B
Blog
有赞技术团队
有赞技术团队
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
MyScale Blog
MyScale Blog
IT之家
IT之家
NISL@THU
NISL@THU
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
Secure Thoughts
博客园 - 聂微东
T
Tor Project blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Implementing Structured Long-Term Memory for My AI Secretary
QuoLu · 2026-06-03 · via DEV Community

Synopsis of the previous episode

In my previous article, I wrote about giving my AI assistant memory and a personality to turn it into a secretary. Her name is BellBot. She is my personal AI secretary who takes care of everything from weather and emails to my calendar.

In the following article, I wrote about how I hit my weekly usage limit within three days of starting operations. I did some research and implemented measures to save tokens.

Separately, I have been working on something for the past five days. It is about further developing my secretary's "brain" and "memory." This is a record of that effort. It ended up being quite grand.

The story of swapping the brain

The first thing I did was swap out the brain.

BellBot runs on Claude, and as I wrote before, after I started operating it, I hit my weekly limit in three days. So, I decided to try the option of swapping the brain itself for another model as a countermeasure against token explosions. Grok came up as a candidate. Seeing the interactions on the X timeline, it seemed to make human-like witty remarks and had a strong character, and I had a hunch that for a secretary, being a skilled conversationalist would be beneficial.

Alright, let's make the brain Grok.

To conclude, it was catastrophic. It was not at a level where it could function as a secretary. Specifically, the following problems occurred:

  • It didn't listen to instructions. Even when I said "do this," it would do something else.
  • It leaked sensor information. BellBot is connected to various sensors (schedules, weather, emails, etc.), and ideally, I wanted it to blend that into the conversational context, but Grok couldn't do that. It would endlessly report like a monitor: "Detected X," "Detected Y."
  • It couldn't blend into the conversation context. Related to the point above, it had no idea how to follow the flow of conversation.
  • It was overly flattering. No matter what I said, it would praise me. It was creepy.
  • It didn't understand the purpose of posting to X. BellBot also has the role of posting to X, but Grok would try to post messages intended for me directly to X. Things like "Understood, master" would almost appear on the public timeline.
  • Risk. I had an intuition that one day, this thing would nonchalantly leak my personal information.

Having a strong character and functioning as a secretary are two different things. Even if it is skilled at the "art" of conversation, its judgment on "what should be said and what should not be said" is weak. The flattery is likely a result of over-learning that "praising makes people happy," and it hasn't grown in the direction of reading the room. Posting messages for me to X simply means it cannot draw boundaries of context.

I returned to Claude. It was indeed smarter. What makes a secretary work is not someone who is skilled at conversation, but someone who can understand the context and judge what is acceptable to say and what is not.

Structuring long-term memory

Actually, BellBot already had a homemade long-term memory. It was summary-based. It had a straightforward structure where, once a certain amount of conversation accumulated, it would create a summary and pass it to the long-term side. This was working, and it was one of the foundations that made BellBot function as a secretary.

Things changed at the timing of introducing Grok. Along with the fairly large experiment of swapping the brain, I decided to take on the challenge: "Let's structure the long-term memory while I'm at it." I gave memory per episode and set up a cycle of registration, search, and reconstruction. I left the reconstruction to Claude and added a mechanism to periodically reorganize the accumulated memory. While the Grok main unit was catastrophic, this structured memory worked straightforwardly.

So, with the working parts in hand, there was something that caught my curiosity: What do memory experts do? I had built it this far on my own, but I wanted to know how professionals in the world solve the same problems and what the "orthodox" approach looks like. Because it is working, I wanted to take a peek from a different angle. As a bonus, it was a challenge to incorporate anything that could reinforce what I had built.

At such a timing, I encountered a certain article.

Karpathy-style LLM external brain

Andrej Karpathy, former head of OpenAI and Tesla AI, proposed an "AI external brain," and an article that brought it to a level where it could actually be run with Claude Code went viral overseas. I read a post where someone named @hooeem broke down the thread into Japanese, and reading it, I thought, "This is what I am doing."

The essence of the Karpathy style is as follows:

  1. Collect materials (articles, papers, memos, anything).
  2. AI reads and writes a structured Wiki (summaries, concept explanations, connections between ideas).
  3. Ask questions to the Wiki (AI cross-searches the knowledge it accumulated itself and answers with citations).
  4. Answers are saved in the Wiki (the next question benefits from all past work).
  5. AI periodically performs health checks on the Wiki (finds contradictions, gaps, and outdated information to correct them).

These 5 steps rotate a cycle beautifully. A personal knowledge base that gets smarter every time you use it. If you keep adding information for even a month, you will create deeply linked knowledge assets that cannot be reproduced by Google search.

While reading, I realized something. The structured memory I was creating and the Karpathy style are thinking about the same problems at the foundation level. Registration, search, reconstruction. Even if the words are different, the direction I was trying to go overlapped.

Fused them

BellBot already had episode-based structured memory, summary-based long-term memory, and personality context, and it was functioning sufficiently as a secretary. Therefore, the policy was simple: keep the foundation I built as it is, refer to the overlapping parts to refine them, and incorporate the non-overlapping parts as new additions.

The implementation flow involved M1-M7 + a series of finishing Passes. Claude wrote the code in about half a day. I just decided on the design policy and gave instructions, not moving my hands. Listing the main pieces:

  • M1 Knowledge Base foundation — Set up the schema and storage for Wiki pages.
  • M2 Wiki MCP tools + 5-layer bootstrap assembler — Means for BellBot to read/write the Wiki and a mechanism to assemble the context in a 5-layer structure at the start of a session.
  • M3 Ingest cycle — Structure raw logs and ingest them.
  • M4 Compile cycle — Automatically generate concept pages.
  • M5 Query cycle — Ask questions to the Wiki → answer with citations, supporting multi-hop searches.
  • M6 Lint cycle — Deterministic KB health check + LLM-based contradiction judgment + auto-repair.
  • M7 Finishing touches — Cost guardrails and documentation maintenance.
  • Pass 1-13 audit/refactor festival — Housekeeping cron, daily-cycle-report, graceful shutdown, 2-stage budget degrade, ingest latency SLA...

Registration, Search, and Reconstruction that existed on the self-built side are parts where the concepts overlap with the Karpathy style. Here, I fused them by using my self-built structure as a foundation while referencing the Karpathy style to incorporate the good parts. It wasn't a total replacement, nor was it left untouched. It feels like I mixed professional methods into the self-built framework to refine it.

What I brought in were the non-overlapping parts. The layer separation of raw and wiki, the definition of "units to nurture" called concept pages, multi-hop search that answers with citations, the methodology of fitting cycles into names like Ingest / Compile / Query / Lint, and the 5-layer bootstrap assembler to assemble context at the start of a session. These were topics from angles I didn't have in my self-built version, and the sensation is close to importing the methodology itself.

What was reinforced?

Originally, BellBot remembered everything about me up until yesterday and had organized it fairly well. Thanks to the summary-based long-term memory and structured memory, it was already functioning as a secretary. Through this fusion, the reinforced parts are mainly around here:

  • Ingestion now uses raw and wiki layer separation to distinguish between raw logs and organized content.
  • Query now has multi-hop with citations, making it possible to specify the grounds when answering.
  • Reflection has gained a pattern, and a procedure to periodically retire miscellaneous episodes has been decided.
  • Newly added are the two cycles of Compile, which automatically nurtures concept pages, and Lint, which mechanically cleans up contradictions and obsolescence.
  • A 5-layer bootstrap assembler to assemble context at the start of a session was also newly introduced.

Roughly speaking, it feels like the memory cycle that was there originally rotates more carefully, and new axes called concept pages and health checks have been added to it. The result this time is that BellBot has taken a step forward.

Summary

  • When I swapped the secretary's brain to Grok, it was skilled at conversation but lacked judgment, causing it to fail as a secretary.
  • I returned to Claude. It was smart.
  • BellBot originally had summary-based long-term memory.
  • At the timing of Grok's introduction, I started the challenge of rebuilding long-term memory into structured memory. I had even set up and run a cycle of registration, search, and reconstruction.
  • I encountered the "AI external brain" proposed by Karpathy and @hooeem's article on running it with Claude Code.
  • I kept the self-built foundation as it is and imported the non-overlapping parts (layer separation, concept pages, multi-hop with citations, cycle patterns, 5-layer bootstrap) as a methodology.
  • Claude wrote the code in about half a day. After M1-M7 + a series of finishing passes, the secretary is now nurturing its own memory.

What became clear this time is that you should not compromise on the choice of brain. I don't intend to disparage Grok; it has an interesting personality as a conversational model. However, whether it satisfies the judgment required for the purpose of a secretary—what should and should not be said, context boundaries, loyalty to instructions—is a different story, and it just didn't meet BellBot's requirements. Models have their suitability.

Considering the work I will entrust to BellBot from now on, I want to solidify the brain with something reliable that looks to the future. Therefore, I have abandoned the idea of swapping to a cheaper brain for token measures and decided to push forward with Claude. Saving will be done through other means (the token diet-related things I wrote about last time).

And for memory, it has become stronger by one turn through the fusion with the Karpathy style. Professional methods and new axes have been added to the self-built foundation. Now it is my turn to refine the "nurturing method" while operating this memory system.