Skip to main content

Quick Start

Get started with Gentic in minutes. This guide will walk you through installing the SDK, creating your first agent, and setting up a simple workflow.

Installation

Install the Gentic SDK using npm:

npm install @gentic/sdk

Configuration

Create a new instance of the Gentic client:

import { GenticClient } from '@gentic/sdk';

const client = new GenticClient('your-api-key');

Create Your First Agent

Let's create a simple agent that can answer questions about your documentation:

const agent = await client.createAgent({
name: 'Documentation Assistant',
description: 'An agent that helps answer questions about documentation',
capabilities: ['chat', 'document-search']
});

Connect Knowledge Sources

Add your documentation as a knowledge source:

// Upload documentation files
const knowledgeSource = await client.createKnowledgeSource({
name: 'Documentation',
type: 'file-collection',
files: [
{
path: 'docs/intro.md',
content: '...'
},
{
path: 'docs/getting-started.md',
content: '...'
}
]
});

// Connect the knowledge source to your agent
await client.connectKnowledgeSource(agent.id, knowledgeSource.id);

Create a Simple Workflow

Define a workflow for handling documentation queries:

const workflow = await client.createWorkflow({
name: 'Documentation Query Handler',
steps: [
{
type: 'search',
query: '{{user_query}}',
knowledgeSourceId: knowledgeSource.id
},
{
type: 'generate',
prompt: 'Based on the following documentation, answer the user\'s question: {{search_results}}',
model: 'gpt-4'
}
]
});

// Assign the workflow to your agent
await client.assignWorkflow(agent.id, workflow.id);

Test Your Agent

Now you can interact with your agent:

const response = await client.converse(agent.id, {
message: 'How do I create an agent?',
history: []
});

console.log(response.content);

Next Steps