No project description provided
Project description
Agentic Patterns
Implementing the agentic patterns using Groq
No LangChain, no LangGraph, no LlamaIndex, no CrewAI. Pure and simple API calls to Groq.
Introduction
This repository contains an implementation of the 4 agentic patterns as defined by Andrew Ng in his DeepLearning.AI blog article series.
Here’s a description of the four patterns we will be implementing.
The 4 Agentic patterns
Reflection Pattern 🤔
A very basic pattern but, despite its simplicity, it provides surprising performance gains for the LLM response.
It allows the LLM to reflect on its results, suggesting modifications, additions, improvements in the writing style, etc.
Want to see how this pattern is implemented? 💻
- Check the notebook for a step by step explanation
- Check the
ReflectionAgent
for a complete Python implementation
Take a look at the YouTube video! 👇
Tool Pattern 🛠
The information stored in the LLM weights is (usually) not enough to give accurate and insightful answers to our questions
That's why we need to provide the LLM with ways to access the outside world 🌍
In practice, you can build tools for whatever you want (at the end of the day they are just functions the LLM can use), from a tool that let's you access Wikipedia, another to analyse the content of YouTube videos or calculate difficult integrals in Wolfram Alpha.
Tools are the secret sauce of agentic applications and the possibilities are endless! 🥫
Want to see how this pattern is implemented? 💻
- Check the notebook for a step by step explanation
- Check the
ToolAgent
for a complete Python implementation - Check the
Tool
for understanding how Tools work under the hood.
Take a look at the YouTube video! 👇
Planning Pattern 🧠
So, we've seen agents capable of reflecting and using tools to access the outside world. But ... what about planning, i.e. deciding what sequence of steps to follow to accomplish a large task?
That is exactly what the Planning Pattern provides; ways for the LLM to break a task into smaller, more easily accomplished subgoals without losing track of the end goal.
The most paradigmatic example of the planning pattern is the ReAct technique, displayed in the diagram above.
Want to see how this pattern is implemented? 💻
- Check the notebook for a step by step explanation
- Check the
ReactAgent
for a complete Python implementation
Take a look at the YouTube video! 👇
Multiagent Pattern 🧑🏽🤝🧑🏻
You may have heard about frameworks like crewAI or AutoGen, which allow you to create multi-agent applications.
These frameworks implement different variations of the multi-agent pattern, in which tasks are divided into smaller subtasks executed by different roles (e.g. one agent can be a software engineer, another a project manager, etc.)
Want to see this pattern in action?
TBD
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for agentic_patterns-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a139df4722976c1bb2ee5f3b1d4f276dee6a91004b6872f0f0b1f6cd926032c |
|
MD5 | bd6ba282c04f05c280159ea572c94126 |
|
BLAKE2b-256 | 5f0e85984e1bc4f252f4e100b146c1db9a770e96e5dfa98aa3b93047907ab4c9 |