Skip to main content

Integration Examples

This guide provides practical examples of common integration scenarios with Gentic.

Customer Support System

Knowledge Sources

// Connect support documentation
const docsSource = await client.createKnowledgeSource({
name: 'Support Docs',
type: 'document',
config: {
path: './docs/support',
format: 'markdown'
}
});

// Connect ticket database
const ticketSource = await client.createKnowledgeSource({
name: 'Ticket System',
type: 'postgresql',
config: {
host: 'localhost',
port: 5432,
database: 'support',
table: 'tickets'
}
});

Workflow

const supportWorkflow = await client.createWorkflow({
name: 'Ticket Resolution',
steps: [
{
type: 'classify',
input: '{{user_message}}',
categories: ['billing', 'technical', 'account']
},
{
type: 'search',
query: '{{classification}} {{user_message}}',
sources: ['support_docs', 'ticket_history']
},
{
type: 'generate',
prompt: 'Based on the search results, provide a solution',
context: {
ticket_type: '{{classification}}',
user_history: '{{user_tickets}}'
}
},
{
type: 'action',
name: 'update_ticket',
params: {
status: 'resolved',
solution: '{{generated_solution}}'
}
}
]
});

E-commerce Recommendation System

Knowledge Sources

// Connect product catalog
const productSource = await client.createKnowledgeSource({
name: 'Product Catalog',
type: 'mongodb',
config: {
uri: 'mongodb://localhost:27017',
database: 'ecommerce',
collection: 'products'
}
});

// Connect user behavior data
const behaviorSource = await client.createKnowledgeSource({
name: 'User Behavior',
type: 'bigquery',
config: {
projectId: 'ecommerce-project',
dataset: 'user_analytics',
table: 'behavior'
}
});

Workflow

const recommendationWorkflow = await client.createWorkflow({
name: 'Product Recommendations',
steps: [
{
type: 'analyze',
input: '{{user_profile}}',
task: 'user_preferences'
},
{
type: 'search',
query: '{{preferences}}',
source: 'product_catalog',
filters: {
in_stock: true,
price_range: '{{user_price_range}}'
}
},
{
type: 'rank',
items: '{{search_results}}',
criteria: ['relevance', 'popularity', 'price']
},
{
type: 'generate',
prompt: 'Create personalized product recommendations',
context: {
user_preferences: '{{preferences}}',
ranked_products: '{{ranked_results}}'
}
}
]
});

Content Management System

Knowledge Sources

// Connect content repository
const contentSource = await client.createKnowledgeSource({
name: 'Content Repository',
type: 'github',
config: {
owner: 'organization',
repo: 'content',
branch: 'main'
}
});

// Connect media storage
const mediaSource = await client.createKnowledgeSource({
name: 'Media Storage',
type: 's3',
config: {
bucket: 'media-content',
region: 'us-east-1'
}
});

Workflow

const contentWorkflow = await client.createWorkflow({
name: 'Content Publishing',
steps: [
{
type: 'validate',
input: '{{content}}',
rules: ['format', 'style', 'seo']
},
{
type: 'transform',
input: '{{content}}',
operations: ['optimize_images', 'format_markdown']
},
{
type: 'generate',
prompt: 'Create meta description and tags',
context: {
content: '{{transformed_content}}'
}
},
{
type: 'publish',
content: '{{transformed_content}}',
metadata: '{{generated_metadata}}'
}
]
});

Data Analytics Pipeline

Knowledge Sources

// Connect data warehouse
const warehouseSource = await client.createKnowledgeSource({
name: 'Data Warehouse',
type: 'snowflake',
config: {
account: 'company.snowflakecomputing.com',
warehouse: 'ANALYTICS',
database: 'ANALYTICS_DB'
}
});

// Connect visualization tool
const vizSource = await client.createKnowledgeSource({
name: 'Visualization',
type: 'tableau',
config: {
server: 'https://tableau.company.com',
site: 'Analytics'
}
});

Workflow

const analyticsWorkflow = await client.createWorkflow({
name: 'Daily Analytics',
trigger: {
type: 'schedule',
config: {
cron: '0 6 * * *' // Daily at 6 AM
}
},
steps: [
{
type: 'query',
sql: 'SELECT * FROM daily_metrics',
source: 'data_warehouse'
},
{
type: 'transform',
input: '{{query_results}}',
operations: ['aggregate', 'calculate_kpis']
},
{
type: 'generate',
prompt: 'Create insights from the data',
context: {
metrics: '{{transformed_data}}',
trends: '{{historical_comparison}}'
}
},
{
type: 'update',
target: 'dashboard',
data: '{{insights}}'
}
]
});

Next Steps