r/AI_Loops • • Jun 24 '26

Agentic Looping done easy (python)

I built my own loops framework.

It's totally customizable and starts with strict rules: ruff lint, pyling pyright, semgrep, etc. And added a preferences file for my coding quirks. Like I HATE when agents use underscore naming and ruff and pylint dont catch that. So i made it a rule in my preferences python file. And there's a small dumb shell script that takes in iteration count and max minutes alloted to each agent. Then it just loops. I just the framework for all my projects now. Just drop in my plan in the plan.md and adjust it periodically. Apparently there are companies building and trying to sell stuff like this as a product, which is ridiculous to me. https://github.com/rxdt/py_ralph_frame

2 Upvotes

2 comments sorted by

1

u/michaelTM_ai Jun 24 '26

took a look through the repo, this is more legit than the post makes it sound. The good part imo is that Ralph is dumb in the right place: ralph.sh just injects PROMPT.md, sets RALPH_LOOP=1, records runs, and stops on timeout/nonzero exit. The real design is the repo boundary: specs/ + PROJECT_STATUS.md as memory, commit-time containment in gate.py, then pre-push/CI with pyright, pylint, semgrep, pytest + coverage. That’s a cleaner loop than most agent framework stuff because the agent can wander during an iteration, but it has to leave a reviewable commit. Curious where it breaks for you: do agents mostly fail by wandering from specs/, or by gaming the tests/gate while technically passing?

2

u/roxthegame Jun 25 '26

I learned pretty quickly that ghuntly https://ghuntley.com/ralph/ is very rcorrect when he says 'don't contain the agent'. I wanted it all - security + active self-manaaged agents. So i set early loops with some sandboxing-like features. Ended up with agents frantically trying to commit but unable to because semgrep was not recognizing them as people -- because of their sandbox permissions. File changes just piled up at the gate. It would have been comical if animated. Weird cases like that would pop up.

My first PROMPT.md was not specific enough and told agents, essentially, manage yourself. So they got lazy. Like literally I would have entire loops where no work was done? Wording has to be super precise, per usual, and more so with many headless iterations you won't actually interact with. And of course it always feels like a game of cat and mouse. Right when you think you have all the cases pinned, an agent will assure you everything is fine and look, but then you look deeper and... WTF. Every day something new.