6 ms·
Agentic patters from scratch using Groq
- mtrofficus 2y agoI wanted to share a GitHub repository I've started a couple of months ago where I'm implementing, from scratch, the 4 agentic patterns as defined by Andrew Ng: Reflection pattern, Tool pattern, Planning pattern and Multiagent pattern.
- tcdent 2y agoYou put more work into the README than you did the entire codebase.
- someoneontenet 2y agoThe readme was the most important part for me!
- mtrofficus 2y agoglad you find it useful :)
- mtrofficus 2y agopeace man xD I mean, I didn't want to make a new framework, just try to offer some educational value. But sure, the code needs a refactor! :)
- lolinder 2y agoHere's the link to Andrew Ng's letters where he lays these out: https://www.deeplearning.ai/the-batch/how-agents-can-improve-llm-performance/ https://www.deeplearning.ai/the-batch/how-agents-can-improve... This is the first letter, which is an introduction and ends with an index for the letters where he introduces four patterns.
- bbor 2y agoWow, thanks for sharing, that’s hilarious. Even in the one about “multi agent” systems theres no reference older than 2023. I know I shouldn’t be shocked by how arrogant the connectionist got with their (arguably unexpected) success, but I can’t help it! They legit act like “AI” is a new phenomenon, which is especially funny for someone like Ng, who’s been an AI celebrity for at least a decade. No hate—his course was my first intro to real ML & AI, like I’m sure it was for many of us. Just a teeny bit of righteous condescension, I guess. For anyone interested in this kind of stuff, this would be the super-popular first stop: Marvin Minsky’s Society of Mind https://en.wikipedia.org/wiki/Society_of_Mind https://en.wikipedia.org/wiki/Society_of_Mind https://courses.media.mit.edu/2016spring/mass63/wp-content/uploads/sites/40/2015/09/Society-of-Mind.pdf https://courses.media.mit.edu/2016spring/mass63/wp-content/u...
- vardhanw 2y agoThe society of mind is an interesting reference. I remember browsing through it around the late 90's when it came out. It seemed to provide some theory for the basis of some of our cognitive functions in terms of a collection of cooperating agents. But then, I guess, what the agents themselves are made of was not clear/understood? Are today's LLM models capable of taking the form of those agents, and can we take inspiration from SoM to see how they can evolve together towards a more powerful (real/AG?) intelligence?
- throwaway314155 2y agoWhy Groq? edit: I'm dumb. Thought Groq was the Elon thing.
- NitpickLawyer 2y agoFast (suited for agents) and generous free tier (14k req/day for 70B models) would be my guess.
- mtrofficus 2y agoMuch better explained than my own comment xD
- talldayo 2y ago[flagged]
- throwaway314155 2y agoCyberTruck*
- talldayo 2y ago[flagged]
- makk 2y agoAren’t they a reference to Heinlein? Seems “grok” is on point for what it does.
- mtrofficus 2y agoThat's from Groq documentation: "In fact, our name comes from the word “grok” which means the ability “to understand profoundly and intuitively.”"
- mtrofficus 2y ago
- joeblubaugh 2y agoIs it me, or are the patterns somewhat tautological?
- MPSimmons 2y agoI think the Tool Use is. It would be more accurate and enlightening if it were clear that there were a single agent making the decision on which tool to use, rather than making it look like you're calling one of four tool agents (or if you ARE calling four agents, then the discriminating agent in front of them is being left out).
- mtrofficus 2y agohey! I thought the diagram was clear, but I can see it's not. Thanks for the advise!! I'll try to change it so that it's clear we are using just one agent :)
- MPSimmons 2y agoI really like what you've done overall. Great job! Thank you!
- hu3 2y agoAmazing diagrams. Did you use https://excalidraw.com https://excalidraw.com?
- mtrofficus 2y agoyep!!
- racl101 2y agoThat tool is the bees knees.
- mtrofficus 2y ago100% amazing
- deleted 2y ago[deleted]
- asaph 2y agotypo in title: “patters” should be “patterns”.
- mtrofficus 2y agoups, you're right. Sorry for that.
- arunmu 2y ago> No LangChain, no LangGraph, no LlamaIndex, no CrewAI Bless you. Using these over complicated abstractions (except CrewAI which I haven't yet checked out) never made sense to me. I understand that LLM is no magic wand and there is a need to make it systematic rather than slapping prompts everywhere. But these frameworks are not the solution to it. Next I will be looking at is Microsofts semantic-kernel. Anybody has any good words for it ?
- asabla 2y agoBuilt a couple of things with Semantic Kernel. Both some private test projects, but also two customer facing applications and one internal. It's heavily tilted towards OpenAI and it's offerings (either through OpenAI API or through Azure). However, it works decent enough for other alternatives as well, like: huggingface or ollama. Compared to the others (CrewAI etc). I kind of feel like Semantic Kernel hasn't really solved observe ability yet. Sure you can connect what ever logging/metric solution .Net supports, but it's not as seamless like the others. Semantic Kernel is available in .Net, Java and Python. But it's quite obvious .Net is a lot more polished then the others. Python usually gets new features faster, or at least pocs or previews. Some learnings from it all: - It's quite easy to get started with - I like the distinction between native plugins and textbased ones (if a plugin should run code or not) - There is a feeling of black magic in the background, in the sense of observe ability - A bit more manual work to get things in order, compared to the alternatives - Rapid development, it's quite clear the development team from Microsoft is doing a lot of work with this library All and all, if you feel comfortable with writing C#, then Semantic Kernel is totally a viable option. If you prefer python over anything else, then I would say llamaindex or langchain is probably a better option (for now). edit: updated some formatting
- arunmu 2y agoThanks. I would have preferred to use Go instead of Python, but somehow the language is not picking up a lot in terms of new LLM frameworks. As of now, I am using very light weight abstractions over prompts in python and that gets the job done. But, it is way too early and I can see how pipelining multiple LLM calls would need a good library that is not too complex and involved. In the end it is just a API call and you hope for the best result :)