Ask HN: Do you roll your own agent or use a framework?

11 pointsposted a month ago
by break_the_bank

Item id: 45502646

7 Comments

extasia

a month ago

I wrote my own agent state machine in pretty much pure async Python (no libs). Running successfully in prod with very few issues.

I use the OpenAI messages spec, and have the messages be an append only list, to make it easy to reason about.

Don’t bother compacting histories imo. worse case just summarise and spin up a new agent with the context.

good luck!

nbbaier

a month ago

Is this code open source?

jamesbriggs

a month ago

We used frameworks in the past, tried langchain, langgraph, and Openai's agents SDK pretty extensively. Now we roll our own, generally a much better and cleaner experience. We essentially built our own internal framework for our own use-case, we liked the graph approach of langgraph - so we took elements of that. We write everything async, and added nice handling for streaming.

You can see our framework [here](https://github.com/aurelio-labs/graphai). I don't necessarily recommend it as it's built for our use-cases and I make no guarantees for others, but it might be interesting to see what rolling your own might look like

drakonka

a month ago

For my run training agent hobby project I'm just building my own, it's fun and lets me focus on building stuff rather than wrangling frameworks.

brazukadev

a month ago

Yes, I created my own AI framework but now on top of MCP so it can integrate with other servers and clients.

walpurginacht

a month ago

used langchain and churned out of it due to it's abstraction level. Nowaday I either just use pydantic-ai or dspy.

tag_coder

a month ago

I am enjoying langgraph.

Non-technical people have suggested using other tools like n8n or make.

Being able to write tests, use version control, and make full use of a programming language I am proficient with are perks.

It is also enshittification resistant unlike other platforms. I still might use them for something lightweight.

I have rolled my own solutions in previous roles and it worked well for very simple tasks (analyze this output and make sure it meets this criteria or try again...) I would be concerned about complexity if there were more steps, tool calls, or the need to compose multiple agents out of the same nodes, tools, state, etc...

Curious to hear more what you mean about compacting histories? Langgraph state management is simple enough and a custom reducer function gives you full control of context management...