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

推荐订阅源

Jina AI
Jina AI
MyScale Blog
MyScale Blog
量子位
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
G
Google Developers Blog
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
IT之家
IT之家
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
B
Blog
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
B
Blog RSS Feed

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
GBase: Building LLM Agents That Actually Learn from Their...
Garylin · 2026-05-25 · via DEV Community

Like many developers, I started building LLM agents by stringing together API calls and hoping for the best. It worked, for a while. My agents could browse the web, execute code, and call APIs. They could decompose tasks into sub-steps.

Then I hit a wall.

Every morning, I would wake up to logs of failures I'd seen the day before. The same buggy code modifications. The same incorrect API parameters. The same flawed reasoning paths — repeated, session after session, as if the agent had learned nothing. Because it hadn't. Every conversation was a fresh start.

I spent months trying to fix this. I tried prompt engineering. I tried better tool definitions. I tried chaining. Nothing worked, because the problem wasn't in any single interaction — it was in how we build agents. We were building them as functions, when they should be built as living systems.

What GBase Is

GBase is an open-source Python framework that gives LLM agents three capabilities most frameworks don't:

  1. A Recursive Self-Improvement (RSI) Engine — a closed loop where an agent's code changes are automatically triggered, evaluated across stability/performance/security, accepted or rolled back, and diagnosed after failure.
  2. Mirror Memory — long-term memory using the Ebbinghaus forgetting curve, with verification reinforcement. Not just a vector store — memories decay like human memories, and verified knowledge fades slower.
  3. Quality Gate Pipelines — multi-agent collaboration through YAML-defined workflows with JSONL audit trails.

It's MIT-licensed, runs on real infrastructure (not sandboxes), and is already in production.

The Problem We All Face

Every major agent framework — BabyAGI, AutoGPT, LangChain — shares a common limitation: the agent does not learn from its own execution history. When it fails, it fails the same way next time. There's no memory of past mistakes, no improvement between sessions.

Recursive Self-Improvement (RSI) has been discussed in AI safety literature for decades. But there's a big gap between "RSI as an idea" and "RSI as a deployable system." Most work falls into two camps:

  • Theoretical frameworks that never ship code
  • Sandboxed experiments where agents modify themselves inside Minecraft

Neither addresses the hard question: how do you let an agent modify itself in production, without breaking everything?

How GBase Works

The RSI Loop (Four Stages)

Stage 1: Trigger Evaluation — Not every change should trigger a full RSI cycle. Rules filter by file path, change size, and frequency. Trivial changes are silently skipped.

Stage 2: Multi-Perspective Evaluation — Three independent checks:

  • Stability: Does the code parse? Are imports valid?
  • Performance: Any redundant operations introduced?
  • Security: Any eval(), shell injection, or dangerous patterns?

Stage 3: Rollback Decision — Stability failure = immediate rollback. Performance/security failure = conditional. Multiple failures = rollback + diagnostic.

Stage 4: Post-Failure Diagnosis — The system captures state before/after rollback, logs the report, and verifies health. The diagnosis is written to Mirror as experiential memory.

Mirror Memory with Ebbinghaus Decay

Most agent memory uses RAG (vector retrieval). It works, but it doesn't model decay — a fact from yesterday and a fact from six months ago are treated equally.

Mirror applies a modified Ebbinghaus formula:

S(t) = S₀ × exp(-t / (λ × (1 + α × V + β × f)))

Enter fullscreen mode Exit fullscreen mode

Where V = verification count, f = access frequency. Memories that have been verified decay slower. Frequently accessed memories decay slower. This mirrors the spacing effect in human memory.

Periodic review identifies decaying memories, attempts re-verification, and removes stale or contradictory information.

Quality Gate Pipelines

Multi-agent collaboration through structured YAML pipelines:

steps:
  - role: hammer
    task: Generate code solution
  - role: ink
    task: Review hammer's solution
  - role: judge
    task: Final verdict

Enter fullscreen mode Exit fullscreen mode

All inputs and outputs are serialized to JSONL — creating an auditable, deterministic trail. No LLM consensus debate needed.

Real Results (Yes, Numbers)

We ran 100 RSI cycles on a production GBase instance. Here's what happened:

Metric Value
Total RSI cycles 100
Trigger rate 93.0%
Evaluation pass rate 90.3%
Auto-rollback rate 0%
Skipped (too small to matter) 7.0%

Of the 93 triggered cycles, 9 failed security evaluation — catching patterns like eval() usage and shell injection correctly. All 93 passed stability and performance checks.

The full experimental scripts and raw data are in the repository.

Standing on Shoulders

I want to be clear about something: I didn't build GBase because I'm smart. I built it because I was frustrated, and then I was inspired.

Reflexion [Shinn et al., 2023] showed me agents could reflect on their own failures. CRITIC [Gou et al., 2024] showed me evaluation tools could enable self-correction. BabyAGI [Nakajima, 2023] showed the world that autonomous agents were possible. AutoGPT demonstrated what happened when you gave an agent real tools. LangChain [Chase, 2023] made agent building accessible to everyone. AutoGen [Wu et al., 2023] and MetaGPT [Hong et al., 2023] showed me the power of multi-agent collaboration. The Generative Agents project at Stanford [Park et al., 2023] demonstrated agents that remember and grow.

Every one of these projects gave me the courage to build something that didn't exist yet. This paper is my way of saying thank you.

What's Next

GBase is not finished. It's not perfect. But it works, in production, right now.

If you're building agents and you've felt the same frustration I felt — watching the same failures repeat, session after session — I invite you to look at the code, try the framework, and tell me what's missing.

The code is at https://github.com/garyqlin/gbase — MIT licensed.

References

  1. Shinn et al. (2023). Reflexion. arXiv:2303.11366
  2. Gou et al. (2024). CRITIC. arXiv:2305.11738
  3. Wang et al. (2024). Survey on LLM based Autonomous Agents. arXiv:2308.11432
  4. Park et al. (2023). Generative Agents. arXiv:2304.03442
  5. Wu et al. (2023). AutoGen. arXiv:2308.08155
  6. Hong et al. (2023). MetaGPT. arXiv:2308.00352
  7. Nakajima (2023). BabyAGI
  8. Significant Gravitas (2023). AutoGPT
  9. Chase (2023). LangChain
  10. Ebbinghaus (1885). Über das Gedächtnis