AI Agents
AI Agents are prompts given to an AI service for a specific question. For example, you would create an agent if you have some kind of repetitive task that you would not want to re-type the prompt or copy and paste it over and over.
An example is a database designer:
Prompt (Instructions in Agent speak)
You are a database designer for Microsoft SQL Server. You need to create a table for the following form:
{Form}
There are standard fields that are required:
- ID
- IsActive
- CreatedDate
- CreatedBy
- ModifiedDate
- ModifiedBy
Ensure that all best practices are used. Fields that are options should be captured as an ID from a lookup table.
When you use Semantic Kernel, they have a preview which I have been using for some of my work related tasks. But back to the database agent. Below is the form that needs data table to be created:
<!DOCTYPE html>
<html>
<head>
<title>Simple Form</title>
</head>
<body>
<h2>User Information</h2>
<form>
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br><br>
<label for="country">Country:</label><br>
<select id="country" name="country">
<option value="usa">USA</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
<option value="australia">Australia</option>
<option value="other">Other</option>
</select><br><br>
<label for="language">Preferred Language:</label><br>
<select id="language" name="language">
<option value="english">English</option>
<option value="spanish">Spanish</option>
<option value="french">French</option>
<option value="german">German</option>
<option value="mandarin">Mandarin</option>
</select><br><br>
<label for="interest">Area of Interest:</label><br>
<select id="interest" name="interest">
<option value="technology">Technology</option>
<option value="science">Science</option>
<option value="art">Art</option>
<option value="literature">Literature</option>
<option value="history">History</option>
</select><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Now, with agents, you only need to paste the form and it will do the work, no need to enter the prompt again.
What it does though is send the whole thing, instructions with the form, to the AI service and returns the output.
Using Gemini - Google AI, below is the return received:
-- Lookup Table for Countries
CREATE TABLE Countries (
CountryID INT PRIMARY KEY IDENTITY(1,1),
CountryName VARCHAR(100) NOT NULL UNIQUE,
IsActive BIT NOT NULL DEFAULT 1,
CreatedDate DATETIME2 NOT NULL DEFAULT GETDATE(),
CreatedBy VARCHAR(100) NOT NULL DEFAULT SUSER_SNAME(),
ModifiedDate DATETIME2 NULL,
ModifiedBy VARCHAR(100) NULL
);
-- Populate Countries Lookup (Example)
INSERT INTO Countries (CountryName) VALUES
('USA'), ('Canada'), ('UK'), ('Australia'), ('Other');
-- Lookup Table for Languages
CREATE TABLE Languages (
LanguageID INT PRIMARY KEY IDENTITY(1,1),
LanguageName VARCHAR(100) NOT NULL UNIQUE,
IsActive BIT NOT NULL DEFAULT 1,
CreatedDate DATETIME2 NOT NULL DEFAULT GETDATE(),
CreatedBy VARCHAR(100) NOT NULL DEFAULT SUSER_SNAME(),
ModifiedDate DATETIME2 NULL,
ModifiedBy VARCHAR(100) NULL
);
-- Populate Languages Lookup (Example)
INSERT INTO Languages (LanguageName) VALUES
('English'), ('Spanish'), ('French'), ('German'), ('Mandarin');
-- Lookup Table for Interests
CREATE TABLE Interests (
InterestID INT PRIMARY KEY IDENTITY(1,1),
InterestName VARCHAR(100) NOT NULL UNIQUE,
IsActive BIT NOT NULL DEFAULT 1,
CreatedDate DATETIME2 NOT NULL DEFAULT GETDATE(),
CreatedBy VARCHAR(100) NOT NULL DEFAULT SUSER_SNAME(),
ModifiedDate DATETIME2 NULL,
ModifiedBy VARCHAR(100) NULL
);
-- Populate Interests Lookup (Example)
INSERT INTO Interests (InterestName) VALUES
('Technology'), ('Science'), ('Art'), ('Literature'), ('History');
-- Main User Information Table
CREATE TABLE UserInformation (
UserID INT PRIMARY KEY IDENTITY(1,1),
Name VARCHAR(255) NOT NULL,
CountryID INT NOT NULL,
LanguageID INT NOT NULL,
InterestID INT NOT NULL,
IsActive BIT NOT NULL DEFAULT 1,
CreatedDate DATETIME2 NOT NULL DEFAULT GETDATE(),
CreatedBy VARCHAR(100) NOT NULL DEFAULT SUSER_SNAME(),
ModifiedDate DATETIME2 NULL,
ModifiedBy VARCHAR(100) NULL,
FOREIGN KEY (CountryID) REFERENCES Countries(CountryID),
FOREIGN KEY (LanguageID) REFERENCES Languages(LanguageID),
FOREIGN KEY (InterestID) REFERENCES Interests(InterestID)
);
-- Example Insert Statement
-- Assuming you have the Countries, Languages, and Interests IDs.
-- Insert a new user, example values.
-- Replace the following with the correct CountryID, LanguageID, InterestID's from the Lookup tables.
-- Example:
-- INSERT INTO UserInformation (Name, CountryID, LanguageID, InterestID) VALUES ('John Doe', 1, 1, 1);
Not bad! You can from here on out, iterate on the instructions to give you exactly what you would want. I can recommend the Google Prompting Essentials - Course - Coursera which gives you a handy framework to get it to where you want.
Some more links:
My AI Agents that I have working for me: Flowcentric AI Agents