5 ms·
Build a Basic AI Agent from Scratch: Long Task Planning
- b800h 4mo agoWhy do people use Medium?
- jdw64 4mo agoAt least Medium's algorithm shows it to users within Medium. A personal homepage doesn't get picked up well by SEO, and unless it becomes famous, you can't see any comments from people. Just like my homepage(makonea.com) that no one visits
- antonvs 4mo agoBecause it gives them a way to post articles for free? What should they use instead, your highness? Why do people post comments like this?
- msdz 4mo agoWhat a strange comment. The original post is also available at the poster’s own blog [1], so the question is a very valid one. Clearly, “posting articles for free” is a hurdle already cleared by the author. [1] https://www.ruxu.dev/articles/ai/build-an-ai-agent-planning/ https://www.ruxu.dev/articles/ai/build-an-ai-agent-planning/
- antonvs 4mo agoSomeone else explained it better, if you genuinely don't understand: https://news.ycombinator.com/item?id=48489337 https://news.ycombinator.com/item?id=48489337
- msdz 4mo agoThat is in fact a better explanation due to bringing up different reasons (zero cost to host as you mentioned, vs. network/visibility out-of-the-box in the linked comment).
- niggischiggi 4mo ago[flagged]
- paulluuk 4mo agoThat seems pretty harsh. How do new frontend frameworks, GPU shaders or another article about how great Rust is (which it is) help fight climate change or child starvation?
- reactordev 4mo agoThe point they were making sarcastically is that this, doesn’t.
- bcjdjsndon 4mo ago> great Rust is (which it is) They just took undefined behaviour and called it unsafe. Theyve not really solved anything. Even their own std lib has security bugs in unsafe code. And their only ever retort is "there are thousands of these bugs a day in c code"... Let's wait until rust gets used seriously in the systems and embedded space first, no point comparing c to minnows like rust when it comes to total cves.
- purpleflashing 4mo agoSecurity and safety are two different things.
- bcjdjsndon 4mo agoClutching at straws, as is typical of a rustacean
- deleted 4mo ago[deleted]
- trollbridge 4mo agoSince the migration from setuptools -> poetry -> uv -> full Rust, I think my computer burns up less energy (not to mention all the CI/CD pipelines) from running slow tools over and over. So that's a win for Rust there.
- eugmai86 4mo ago[dead]
- mxkopy 4mo agoJesus the terminology is so fucked… compare the contents of this blog post with any RL paper containing the words “long term planning”…
- elxr 4mo agoCode tutorial on medium (who's formatting is absolutely not meant for this)? Please stop posting.
- preommr 4mo agoelaborate? It's using code blocks that have language highlighting, and the appropriate whitespacing. What's the problem?
- aafaqzahid 4mo agoAre people using medium in 2026?
- Havoc 4mo agoWhat’s with all the aggression here. Not very hn
- int3trap 4mo ago1. People don't like medium, rightly so. 2. The content is lower quality.
- jdw64 4mo agoI find it hard to agree with the point that the content quality is low. Of course, that design does have some issues. But it is still valuable and worth reading. The strengths are that the design forces Chain of Thought as a memory buffer and the TODO list in an FSM style. I think those are fine. The recovery strategy is also pretty good. However, the problem is that the business logic does not run as Python code but lives inside the prompt. And it does not support parallel execution. But as a single run script, it is helpful enough for understanding the concept. Of course, if I were to do the code properly, I would use a separate storage instead of in memory, and more carefully verify tool constraints and the actual scope limitations of the tools. But still, I think this is helpful enough.
- hilariously 4mo agoThe recovery strategy in my mind would be what to do in case of a crash, which would just wipe out all the context here (scratch pad, todo list, etc) - it doesn't seem very recoverable.
- jdw64 4mo agoThis is the difficult part of programming debates. What you mentioned is about the TODO list disappearing immediately when Python shuts down, right? What I was talking about is the point where the LLM retries when something goes wrong due to a mistake in the previous task. Actually, that's why I included the sentence 'If I were to do the code properly, I would use a separate storage instead of in memory.' I guess I unintentionally caused some confusion.
- jdw64 4mo agoI don't understand why people criticize this post. When you run a homepage or a blog, it's unavoidable to write script style code. Even if the quality is a bit low, that's the limit within a tutorial. Because if you go into actual design, things like boundaries, policies, error handling, and so on require a lot of prior knowledge. So when certain knowledge is needed, you can only post something as a simple runnable script. For example, if I were building real software, I would design everything from policy to error logging policies and so on. But when writing a blog post, it's just simplified into a short runnable script.
- athrowaway3z 4mo agoI've tried most form of planning - from the basic AGENTS.md guide to keeping ./dev/ plan files, todo list tools, sqlite db with both minimal and extensive tracking, etc. None of them have been worth it. A year ago the models needed to be reminded. Today they can follow a plan from text alone. This is my experience from working on a project alone - in teams ... i actually think the same lesson holds in the new AI paradigm. My current scheme is basically this - in order of the task's complexity: - Tell an agent to do something - Tell an agent to make a plan then tell it to execute on it. - Tell an agent to make a plan, write to a file, have a subagent review it, then execute it. - Do the above, but instead tell the agent they're in a supervise mode and to have subagents implement as many phases and rollover with a handoff.md while they, as the supervisor agent, keeps driving the task to completion. The latter two i have under a sigil so they're prepared prompts i can inject with a few keystrokes. If i feel very fancy i'll tell them to update the plan with a checklist and add checkboxes, but it just doesn't pay enough to have 'init-prompt' level planning feature or tools if in the same context you already have files/read/write.
- manishsharan 4mo agoPlease don't take offense to this very dumb question: Why can't you do the planning ? Figure out what needs to be done , break it down into small tasks and then ask the agent to execute those small tasks? When we executed projects in the past, this is what I would do as a lead: figure out the overall software architecture and delegate the tasks to developers. This way I always knew how the system worked and could extend it as needed. I am not in development role anymore but I am trying to understand why we are delegating planning and software architecture to coding agents?
- nnnnico 4mo agowhatever you delegated in the past probably also required planning by the engineer that went down and got it done, most planning done by agents is at this same level, agent explores the codebase, understands where to touch, tradeoffs, code-level architecture, and ask the user for more context or balance with assumptions and other patterns already present in code
- volume_tech 4mo ago[flagged]
- swordlucky666 4mo ago[flagged]
- charles_f 4mo ago> In my case, I asked it to migrate my static site from using Eleventy to Hugo This blog is on medium so I guess the migration went sideways! Joke aside, nice series of tutorials, don't let the haters get to you. I think with the current token panic it might get handy soon
- chattermate 4mo ago[flagged]
- andai 4mo agoWhat's the point of the scratch pad? Isn't the same data already in the context? Or does it help because contexts are lossy and bias towards the start and end? Similar question with the to-do list. Do they actually help task completion? Is there any research on that? I think they're less helpful with more recent models, but maybe they still help with smaller ones? The system prompt asking it to make a plan before starting work does sound helpful though. (Of course it would also be great to see numbers there :)
- ELRayano 4mo agoHi, There are few benefits from using scratchpad or any other external platform : - Be agnostic of the LLM you use, tomorow, if the prices of the llm you use are exploding, you can still reuse another LLM by pointing it the scratchpad repository you have. Then, modulo the level of verbosity you had on scratchpad (or other), you'll avoid lossing time ro reexplain everything to the new llm - You can avoid the "summarized" effect obtained through context compaction events . This effect makes accurate and so potential important information a bit more lurry (numbers turned into adjectives, etc/ Scratchpad or Obsidian or any other external solution you might imagine would act as "case fact blocks" that are a solution recommended to mitigate the above effect and thus make the accurate information still available. You can imagine a system where you ask your LLM to read some files within your external storage after each compaction for exemple with a hook or anything else. Regarding the todolist, from my pov, it's just a basic principle of work segmentation and accuracy with some traceability. You are better when you can divide your work into chunks that can be followed individually rather than with a huge block of work. That can also be used within the "ralph wiggum" loop pattern that might help the llm to get a goal and thus iterate until goal completion. There are few articles explaining the concept if that interests you Hope it helps a bit !