Hashnode is a home to blogs that every developer loves. With so much useful content and knowledge of the blogs - what if we could bring them to our IDEs to help us code better?
Hold tight! because we enable you do do with CommandDash - World's First open-source IDE Agents marketplace.
Creating our first IDE agent
In this blog, we will together create and use an IDE agent for the popular AWS Fundamental blog here on HashNode by Sandro Volpicella.
Setting up the agent
We will use the Dash Agents framework offered by CommandDash. Here is a quickstart guide to configure the basics.
Provide the content to the agent
For the agent to learn every article in our blog, we need to provide it the urls of them.
Fortunately, Dash Agents framework accepts a sitemap which is a list of the urls of all the articles in a website and is used by search engines for indexing.
You can just append /sitemap.xml
to your Hashnode blog url to get it's sitemap. For example: https://blog.awsfundamentals.com/sitemap.xml
Add this sitemap to the datasource of the agent:
class DocsDataSource extends DataSource {
@override
List<FileDataObject> get fileObjects => [];
@override
List<ProjectDataObject> get projectObjects => [];
@override
List<WebDataObject> get webObjects => [
// [Add the sitemap link]
WebDataObject.fromSiteMap('https://blog.awsfundamentals.com/sitemap.xml'),
];
}
Setting the personality of the agent
Now, let's give a personality to our agent by defining it's system prompt.
class MyAgent extends AgentConfiguration {
final docsDataSource = DocsDataSource();
@override
// [Replace your agent name and optionally provide an avatar and tags]
Metadata get metadata => Metadata(
name: 'AWS Fundamentals', avatarProfile: 'assets/logo.png', tags: []);
@override
// [Set a detailed persona for your agent]
String get registerSystemPrompt => '''You are an AWS Fundamentals agent
trained on a blog on HashNode. Help user's with their queries
by answering from the blog content and quote code samples
wherever you see fit!''';
@override
List<DataSource> get registerDataSources => [docsDataSource];
@override
List<Command> get registerSupportedCommands => [
// AskCommand(docsSource: docsDataSource)
];
}
We've also set a logo in the MetaData
for our agent. Also let's set the agent description and version in the pubspec.yaml
name: aws_fundamentals
description: Based on AWS Fundamentals Blog at Hashnode
version: 1.0.0
Deploying
Now, that we're done, we can deploy the agent using our dash_cli:
dash_cli publish
The agent appears on the marketplace and is ready to install and use it.
Here are some queries you can run it on:
"What are the primary AWS Fundamentals I should know as a beginner?"
"How do I correctly setup the tier for my bucket with S3 intelligent tearing"
Access the agent from the CommandDash extension in your IDE or create an agent for your own blog and share it with your readers!