4 ms·
I'm building a simple agent accessible over SMS for a family member. One of their use cases is finding recipes. A problem I ran into was that doing a web search
by colonCapitalDee 1y ago
I'm building a simple agent accessible over SMS for a family member. One of their use cases is finding recipes. A problem I ran into was that doing a web search for recipes would pull tons of web pages into the context, effectively clobbering the system prompt that told the agent to format responses in a manner suited for SMS. I solved this by creating a recipe tool that uses a sub-agent to do the web search and return the most promising recipe to the main agent. When the main agent uses this tool instead of performing the web search itself, it is successfully able to follow the system prompt's directions to format and trim the recipe for SMS. Using this sub-agent to prevent information from entering the context dramatically improved the quality of responses. More context is not always better!
I bring this up because this article discusses context management mostly in terms of context windows having a maximum size. I think that context management is far more than that. I'm still new to this building agents thing, but my experience suggests that context problems start cropping up well before the context window fills up.
- edoceo 1y agoAre you in USA? How to get around those 10DLC limits on typical SMS/API things (eg Twilio). Or did you go through that process (which seems a lot for a private use-case)
- colonCapitalDee 1y agoI am in the USA! Although these days that exclamation point doesn't feel great... I'm using an old Android phone (Pixel 2 from 2017), a 5$ a month unlimited SMS plan from Tello, and https://github.com/capcom6/android-sms-gateway https://github.com/capcom6/android-sms-gateway. For bonus points (I wanted to roll my own security, route messages from different numbers to prod and ppe instances of my backend, and dedup messages) I built a little service in Go that acts as an intermediary between my backend and android-sms-gateway. I deploy this service to my android device using ADB, android-sms-gateway talks to it, and it talks to my backend. I also rooted the android device so I could disable battery management for all apps (don't do this if you want to walk around with the phone of course). It works pretty well! I plan to open-source this eventually TM, but first I need to decouple my personal deployment infra from the bits useful to everyone else
- NamPrelude 1y ago[dead]
- _0ffh 1y agoYou mean sub-agent as in the formatting agent calls on the the search-and-filter agent? In that case you might just make a pipeline. Use a search agent, then a filter agent (or maybe only one search-and-filter agent), then a formatting agent. Lots of tasks work better with a fixed pipeline than with freely communicating agents.
- tfirst 1y agoThe article addresses this specific use under the 'Claude Code Subagents' section. > The benefit of having a subagent in this case is that all the subagent’s investigative work does not need to remain in the history of the main agent, allowing for longer traces before running out of context.
- deleted 1y ago[deleted]
- jauntywundrkind 1y agoThis very narrow very specific single-purpose task-oriented subagent was one of the first things talked about in this every lovely recent & popular submission (along with other fun to read points): What makes Claude Code so damn good (and how to recreate that magic in your agent)!? https://minusx.ai/blog/decoding-claude-code/ https://minusx.ai/blog/decoding-claude-code/ https://news.ycombinator.com/item?id=44998295 https://news.ycombinator.com/item?id=44998295
- colonCapitalDee 1y agoHey, thanks for linking this. That was super informative
- faangguyindia 1y agoHistory is nothing just list of dict containing role and messages? You can evict any entry at any point.
- sitkack 1y agoThe large models have all the recipes memorized, you don't need to do a search.
- simianwords 1y agoWhy are you reinventing the wheel? Just use gpt api with search turned on.
- knlam 1y agoYou want to use multiple providers, so if I am not happy with result from gpt, I can switch to perplexity or something else. The power of plug and play is very powerful when you are building agent/subagent systems
- simianwords 1y agoEach LLM provider already has search built in that you can turn on. Claude, Gemini, Grok and GPT all of them have this. I get your point about being able to plug and play but all these providers come with the functionality built in.