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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
人人都是产品经理
人人都是产品经理
H
Heimdal Security Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
V2EX - 技术
V2EX - 技术
小众软件
小众软件
博客园 - Franky
博客园 - 司徒正美
P
Privacy International News Feed
爱范儿
爱范儿
U
Unit 42
博客园 - 叶小钗
The Hacker News
The Hacker News
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Simon Willison's Weblog
Simon Willison's Weblog
N
News and Events Feed by Topic
D
Docker
T
Threatpost
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
L
LINUX DO - 最新话题
Security Latest
Security Latest
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
A
Arctic Wolf
Spread Privacy
Spread Privacy

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
从"玩具"到"教材":一个500行AI框架的自我修养
llimage · 2026-06-27 · via DEV Community

llimage

为什么我要造一个500行的Agent轮子?

你好,我是 FROST 的作者。

2026年了,Agent 框架多得能让人挑花眼:LangGraph 有 34.5M 月下载量,Dify 在 GitHub 斩获 129.8K Stars,各大厂商都在疯狂推自己的 SDK。这种环境下,再写一个"轮子",是不是有点多余?

说实话,我也纠结了很久。

一个困惑:新学者的两难困境

事情要从一次失败的辅导说起。

我帮一个朋友入门 Agent 开发,推荐了 LangChain。结果他学了两个月,还在和 chain.invoke() 搏斗,脑子里依然没有"Agent 到底是怎么工作的"这个概念。

问题出在哪?

现在的框架太强了,强到把所有的复杂性都藏了起来。 你可以三行代码跑起来一个 Agent,但你也永远不知道它内部发生了什么。就像学开车,你学会了踩油门转弯,但发动机是怎么工作的、变速箱怎么换挡,一概不知。

而对于想真正理解 Agent 本质的人来说,这是一个巨大的 Gap:

需求 现有选项
快速开发产品 LangChain/CrewAI
理解底层原理 论文 + 源码
入门级教学框架 ❌ 空白

这个空白,就是 FROST 存在的原因。

FROST 的设计哲学:Less is More

FROST 不是一个生产级框架,它是一个教学框架

这意味着它刻意放弃了:

  • ❌ 复杂的依赖生态(不需要 LangChain)
  • ❌ 丰富的工具集成(没有 100+ 内置工具)
  • ❌ 分布式部署能力(就是单机 Python)

它只保留了三个核心概念:

\`python

Store - 记忆容器(类似神经细胞的存储功能)

class Store:
"""存储上下文、记忆、状态"""
def init(self): self.data = {}

Skill - 纯函数变换(类似神经细胞的处理功能)

class Skill:
"""输入→处理→输出,无状态"""
def call(self, store, *args, **kwargs): pass

Agent - 执行单元(类似神经细胞本身)

class Agent:
"""调用 Skill,操作 Store,完成目标"""
def init(self, skills: list[Skill], store: Store): pass
`\

是的,就这么简单。三个类,不超过 500 行代码。

但正是这种简单,让"理解"变得可能。

一行代码跑起来的 Agent

\`python
from frost import Agent, Store, Skill

定义一个"搜索助手"技能

class SearchSkill(Skill):
def call(self, store, query):
result = web_search(query) # 这里是你的搜索实现
store.set("last_search", result)
return result

创建 Agent 并运行

store = Store()
agent = Agent(skills=[SearchSkill()], store=store)
response = agent.run("北京今天天气怎么样")
print(response)
`\

对比一下用 LangChain 实现同样的功能:

\`python
from langchain.agents import AgentExecutor, create_react_agent
from langchain_openai import ChatOpenAI

... 还有十几行初始化代码

`\

FROST 让你从第一行代码开始,就知道自己在做什么:

  1. Agent 是执行者
  2. Skill 是它的能力
  3. Store 是它的记忆

没有魔法,没有黑箱,只有清晰的数据流。

为什么叫 FROST?

FROST 的全称是 Fractal Remote Organ of Scalable Thoughts——可扩展思维的分形远程器官。

这个名字源于它的设计灵感:神经细胞(Neural Cell)

在生物学中,每个神经细胞都很简单:

  • 接收信号
  • 处理信号
  • 发出信号

但当 亿万个神经细胞 连接在一起,就涌现出了智能。

FROST 试图在软件层面复现这个过程:

Neural Cell          →  Agent
Synapse              →  Skill
Long-term Memory     →  Store
Brain (Emergence)    →  Multi-Agent System

这不是在模仿大脑,而是在学习生物界的智慧:简单单元 + 清晰连接 = 复杂行为。

我的踩坑日记

作为一个从零开始写框架的人,踩的坑比代码行数还多:

坑1:追求"完整"差点毁掉项目

最初我设计了一个包含配置管理、日志系统、错误重试的"完整框架"。写了 2000 行后,我发现:

  • 代码复杂度指数级上升
  • 核心概念被淹没在细节里
  • 教学价值归零

教训:教学框架的第一原则是最小化。功能可以以后加,但第一印象无法重来。

坑2:被"这有什么用"质疑

最常见的质疑是:"你这么简单的框架,生产环境谁会用?"

我的回答是:这不是给生产环境用的。

FROST 的用户画像是:

  • 刚学完 Python,想了解 Agent 的学生
  • 想从应用层深入到底层原理的开发者
  • 想给学生演示 Agent 工作原理的讲师

为特定用户解决特定问题,比"什么都能做"更有价值。

FROST-SOP:思想的开花结果

在 FROST 的基础上,我又开发了 FROST-SOP——一个面向工程实践的 Agent 开发平台。

如果说 FROST 是"理解 Agent"的教材,那 FROST-SOP 就是"使用 Agent"的工具箱。

  • FROST:教学框架,500行代码,揭示本质
  • FROST-SOP:工程框架,完整功能,用于生产

两者共享同样的设计思想:分形架构 + 家族治理,只是侧重点不同。

了解更多:https://gitee.com/liao_liang_7514/frost

加入我们

FROST 还有很多不完善的地方:

  • 文档还在补全
  • 示例还不够丰富
  • 测试覆盖还有提升空间

但这恰恰是一个开源项目的真实状态。

如果你对 Agent 框架感兴趣,无论是想学习原理、贡献代码,还是只是想看看"一个 500 行的框架长什么样",欢迎:


最后

造轮子不是目的,理解轮子才是。

当你读完 FROST 的 500 行代码,希望你收获的不只是一个框架,而是:

"原来 Agent 的本质,就是这么简单。"


如果你觉得这篇文章有帮助,欢迎转发给需要的朋友。

Tags: python, agent, ai, opensource