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

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
罗磊的独立博客
Last Week in AI
Last Week in AI
B
Blog
IT之家
IT之家
S
SegmentFault 最新的问题
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
博客园 - 聂微东
U
Unit 42
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
MyScale Blog
MyScale Blog

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
What's actually inside an AI agent: a 300~ LoC ReAct loop
rulyone · 2026-05-18 · via Hacker News - Newest: "AI"

I wanted to build my own simplification of an AI Agent — to see past the hype, and to figure out what changes when our applications start running one. I had pieces scattered around but never sat down with them.

First, I sketched it in pseudo-code, read a few of the papers that shaped what's now in production, chatted with mainstream agents to fill the gaps, and ended up with this:

Pseudo Code

It's simple, and also a bit error-prone because I'm running a small local model instead of a Frontier one. It answers incorrectly sometimes, and a single bad step poisons the whole chain.

The point I really want to land, though, is how Actions can be anything — and how risky that is once you stop treating it as a demo. The production headlines we've all seen are exactly like this: git commits with secrets inside, source.zip files pushed into npm registries, agents fired off into shells they had no business being in.

An Action is any function call you wire up. If you wire up shell.exec, you have wired up rm -rf for the model, allowing it to delete your files at will.

The loop also makes something else obvious: the context window matters, because every step re-sends the entire history. Keep it small or pay for it on every iteration.

This is how it typically looks in other implementations:

And even with all the workarounds — prompt caching, /compaction, summaries — let's be honest: it isn't in the provider's interest to help you spend fewer tokens. That's how they actually profit from this.

What we as Software Engineers should do is take context management seriously and start building custom agents for our own domains, where Actions can be:

  • Internal API calls.
  • Alerts generation.
  • Database lookups.
  • Web search.
  • Internal process executions.

The point is that once you've written the loop yourself, every "AI assistant" stops being a black box. You start asking the right questions: what's in my context, what can my tools touch, what happens when the model is wrong, how relevant is the Prompt? (hint: very much).