How neural-maze/agentic-patterns-course works
Project Type and Purpose
• This is an open-source Python library (“agentic-patterns”) implementing four LLM agentic patterns (Reflection, Tool, Planning/ReAct, Multiagent) using direct API calls to Groq.
• It’s intended as an educational framework: to teach and experiment with these patterns via notebooks or direct code, not as a deployed web service.
File Structure Analysis
• Top level:
• notebooks/ – Jupyter notebooks demonstrating each pattern.
• src/agentic_patterns/ – the library code, split into subpackages:
– reflection_pattern/ (ReflectionAgent)
– tool_pattern/ (ToolAgent, Tool decorator)
– planning_pattern/ (ReactAgent extends ToolAgent)
– multiagent_pattern/ (Agent, Crew orchestrating DAG)
– utils/ (completions, extraction, logging helpers)
• config/build: pyproject.toml, .env.example, GitHub workflows.
Key Insights from README
• Four patterns each encapsulated by a Python Agent class.
• Agents internally call the Groq LLM API (via utils/completions).
• Tools are user-defined Python functions decorated with @tool; ToolAgent and ReactAgent invoke them.
• Crew builds a DAG of Agents, plots it, then executes steps.
• Notebooks drive usage and learning.
Main Components
a. User Layer
– Notebooks or Python scripts that import agentic_patterns.
b. Agentic-Patterns Library
• reflection_pattern: ReflectionAgent
• tool_pattern: ToolAgent + @tool decorator + Tool class
• planning_pattern: ReactAgent (planning + tools)
• multiagent_pattern: Agent, Crew (DAG orchestration)
• utils: CompletionsClient (Groq API wrapper), Extraction, Logging
c. External Services
– Groq LLM API
– Optional external APIs (e.g. Hacker News, Wikipedia, Wolfram Alpha) used by Tools
d. File System / Persistence
– Local files (e.g. writing output to .txt in multiagent pattern)
Relationships and Data Flows
• Within Library: Agents call utils.completions → Groq API → LLM responses.
• Crew: resolves Agent dependencies → sequential/parallel invocation → file outputs.
Highlighted Architectural Patterns
• Modular package-per-pattern (separation of concerns).
• Strategy pattern: each Agent encapsulates prompt + behavior.
• Decorator pattern: @tool wraps user functions into callable tools.
• DAG orchestration (Multiagent): similar to workflow engines like Airflow.
• Single external dependency: Groq API, injected via utils/completions.