Documentation
DocumentationQuickstart

Quickstart

In this quickstart guide, we'll walk through the process of creating a Dash Agent that answers questions based on the documentation of any library of your choice. In our case, we will choose Gemini APIs.

We'll use the Dash Agent framework available as dash_agent on pub.dev

Prerequisites

  • Dart SDK installed
  • Basic knowledge of Dart programming language
Dash Agents work with every programming language and are planned to support every IDE.

Create a New Project

First, let's create a new Dash Agent project using the dash_cli tool.

  1. Activate the dash_cli globally:

    dart pub global activate dash_cli 
    
  2. Create a new Dash Agent project:

    dash_cli create gemini
    

This will setup a starter agent project with most of the basic configurations in place.

Configure the Agent

Open the newly created project in your preferred IDE or text editor.

  1. Open the lib folder.

  2. In the lib/data_sources.dart - add the sitemap of the documentation in the Data Source:

     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://ai.google.dev/sitemap_0_of_1.xml'),
           ];
     }

    Note - You can use this Sitemap Finder to find the sitemap of a website. We are also working on adding support for sites that don't have a map.

  3. In lib/agent.dart, update the AgentConfiguration to register the necessary data sources and commands:

    class MyAgent extends AgentConfiguration {
     final docsDataSource = DocsDataSource();
     
     @override
     // [Replace your agent name and optionally provide an avatar and tags]
     Metadata get metadata => Metadata(
         name: 'Gemini', avatarProfile: null, tags: []);
     
     @override
     // [Set a detailed persona for your agent]
     String get registerSystemPrompt => '''You are a Gemini assistant. 
         Help users with their queries to add Gemini to their apps''';
     
     @override
     List<DataSource> get registerDataSources => [docsDataSource];
     
     @override
     List<Command> get registerSupportedCommands => [
           // AskCommand(docsSource: docsDataSource)
         ];
    }

The agent is now configured to answer queries based on the documentation.

Publish the Agent

Dash Agents can be published in the marketplace to be installed by anyone.

Before publishing the agent in live, it is recommended to first try it yourself by publish it as a test agent.

  1. Run the following command to start the agent in test mode:

    dash_cli publish --test
    
  2. Open the CommandDash client (e.g., VS Code extension) and install the gemini agent from the marketplace.

Open Marketplace with the `@` icon on the top right.
  1. In your Dash window, activate the agent by typing @ and gemini and selecting it from the dropdown.
Rendered textFieldLayout in the Dash Panel
  1. Next, you can publish the live agent on the marketplace for everyone to install.
    dash_cli publish
    

Visit our agents repository to check source code of some available agents on marketplace.