Agentic Programming
Agentic Programming
Introduction
Modern LLMs are equipped with the ability to execute functions and interact with external
APIs for producing outputs.
This opens up various possibilties such as querying internal databases or creating websites
and perform detailed analysis .
Agents refer to LLM models tasked with doing a given role. Such as content writer or
SQL analyst
Tool refer to the external functions or APIs that the Agents have access to, examples
are Serper API or DuckDuckGo search that lets Agents perform internet search or
Code Executors that enable Agents to execute a code (Usually, written by an Agent)
Tasks are various objectives the agents are tasked to achieve. Agents may
collaborate and reason with each other for achieving the desired output.
Example 01:
Consider an Agentic Program incharge of making a portfolio website using a Resume and
Github Profile. This program would need the following agents and functionalities.
Resume Researcher : Tasked with gathering information from a resume or linkedin profile.
Github Researcher : Tasked with gathering information and projects from the user's
Github to gather more about the user's skillsets and intrests
Content Writer : Tasked with interacting with the Resume Researcher and Github
Researcher to compile the information provided for the Web Developer to use.
UX Designer : Tasked with designing the webpage and providing feedback and
suggsestions for the web developer.
Web Developer : Should be able to work with the Content Writer and UX Designer to
develop HTML and CSS code.
Quality Analyst : Tasked with reviewing work done by Web Developer and Content
Writer to ensure the content is accurate and relavent.
All these agents needs to work together to acheive the required task.
Example 02:
Consider a python script designed to generate synthetic data based on a database using the
CrewAI framework. The script defines four agents, each with a specific role and goal, and three
tasks that these agents will perform. The agents and their tasks are as follows:
1. Data Modelling Tool (SQL Analyst): This agent is responsible for analyzing a provided
SQL dump and understanding the various tables, the values they hold, and creating a data
model for each table. The expected output is a comprehensive document describing the
data within the data dump provided, including an ER diagram written in Mermaid and
sample values.
2. Subject Matter Expert (SME): This agent acts as an expert salesperson with vast
knowledge . The SME's role is to provide context and information regarding the subject in
hand for a Python programmer tasked with developing synthetic data to mimic a database .
The SME will provide realistic sample values for categorical values.
3. Python Programmer: This agent is tasked with writing Python code to generate synthetic
data based on a SQL dump and data design document. The Python programmer will
consult the SQL analyst for requirements and ensure that the generated data is as realistic
as possible. The expected output is a Python script for generating records for each table for
analytics development.
4. Quality Assurance: This agent's role is to analyze the code and outputs by the SME,
Python Programmer, and SQL analyst to make sure the data generated and the data
design is in accordance with the data dump. The quality assurance agent will ensure that
the data design and the data generated meet the requirements, and that the generated
data is realistic and adheres to the required schema and format.
The script defines three tasks that will be performed by the agents:
1. Data Modelling Task: This task requires the SQL analyst to compile the information
provided on the postgres dump to form a data model and detailed description for each field
of each table in the schema. The SQL analyst should not create additional tables.
2. Data Generation Task: This task requires the Python programmer to compile the
information provided on the postgres dump and the data model to write a Python script to
form realistic synthetic data for the tables provided. The Python programmer should consult
the Subject Matter Expert for some realistic values such as Product Names or Brands.
3. Quality Assurance Task: This task requires the quality assurance agent to ensure that the
document and code generated meets the requirements. The quality assurance agent will
work with the SME, the SQL Analyst, and Python Programmer to make necessary changes
if required.