Docs
Guides & Tutorials
Overview

Guides & Tutorials

Practical guides to help you make the most of AgenticAnts.

Getting Started Guides

Advanced Guides

By Use Case

Customer Support Bots

Monitor conversational AI for customer support:

// Track customer support agent
const trace = await ants.trace.create({
  name: 'customer-support',
  input: customerQuery,
  metadata: {
    customerId: customer.id,
    ticketId: ticket.id,
    channel: 'chat',
    priority: ticket.priority
  }
})
 
// Track satisfaction
await trace.complete({
  output: response,
  metadata: {
    satisfactionScore: feedback.score,
    resolved: feedback.resolved
  }
})

Content Generation

Monitor content creation agents:

# Track blog post generation
trace = ants.trace.create(
    name='content-generation',
    metadata={
        'content_type': 'blog_post',
        'target_length': 1500,
        'seo_keywords': ['AI', 'agents']
    }
)
 
# Track quality metrics
trace.complete(
    output=blog_post,
    metadata={
        'word_count': len(blog_post.split()),
        'readability_score': calculate_readability(blog_post),
        'seo_score': analyze_seo(blog_post)
    }
)

Code Assistants

Monitor AI code generation:

// Track code generation
const trace = await ants.trace.create({
  name: 'code-assistant',
  input: codeRequest,
  metadata: {
    language: 'python',
    complexity: 'medium',
    userId: user.id
  }
})
 
// Track code quality
await trace.complete({
  output: generatedCode,
  metadata: {
    linesOfCode: code.split('\n').length,
    testCoverage: runTests(code),
    lintErrors: lintCode(code)
  }
})

Data Analysis

Monitor data analysis agents:

# Track data analysis
trace = ants.trace.create(
    name='data-analyst',
    input=analysis_request,
    metadata={
        'dataset_size': len(data),
        'analysis_type': 'regression'
    }
)
 
# Track analysis results
trace.complete(
    output=analysis_results,
    metadata={
        'confidence': results.confidence,
        'r_squared': results.r_squared,
        'execution_time': results.time
    }
)

Integration Guides

LangChain Guide

import { ChatOpenAI } from 'langchain/chat_models/openai'
import { AgenticAntsCallbackHandler } from '@agenticants/langchain'
 
const handler = new AgenticAntsCallbackHandler(ants)
const llm = new ChatOpenAI({ callbacks: [handler] })
 
// All calls automatically traced

Full LangChain guide →

AutoGen Guide

from agenticants.integrations import autogen
 
autogen.auto_instrument(ants)
 
# All AutoGen agents automatically traced

Full AutoGen guide →

Framework-Specific Guides

  • Next.js + AgenticAnts - Monitor Next.js AI features
  • FastAPI + AgenticAnts - Python web services
  • Streamlit + AgenticAnts - Data apps
  • Vercel AI SDK - Edge functions

Common Patterns

Pattern: Request/Response Logging

async function loggedAgent(input: string) {
  const trace = await ants.trace.create({
    name: 'agent-call',
    input: input
  })
  
  try {
    const output = await agent.process(input)
    await trace.complete({ output })
    return output
  } catch (error) {
    await trace.error({ error: error.message })
    throw error
  }
}

Pattern: Multi-Step Workflow

def multi_step_workflow(query):
    trace = ants.trace.create(name='workflow')
    
    # Step 1
    with trace.span('step1') as span:
        result1 = step1(query)
        span.set_output(result1)
    
    # Step 2
    with trace.span('step2') as span:
        result2 = step2(result1)
        span.set_output(result2)
    
    trace.complete(output=result2)
    return result2

Pattern: Retry Logic

async function withRetry(operation: () => Promise<any>) {
  const trace = await ants.trace.create({ name: 'retry-operation' })
  
  for (let attempt = 1; attempt <= 3; attempt++) {
    try {
      const result = await operation()
      await trace.complete({ 
        output: result,
        metadata: { attempts: attempt }
      })
      return result
    } catch (error) {
      if (attempt === 3) {
        await trace.error({ error: error.message })
        throw error
      }
      await new Promise(r => setTimeout(r, 1000 * attempt))
    }
  }
}

Video Tutorials

  • Getting Started (5 min) - Quick intro to AgenticAnts
  • LangChain Integration (10 min) - Step-by-step setup
  • Cost Optimization (15 min) - Reduce AI spending
  • Production Deployment (20 min) - Enterprise setup

Community Guides

Browse community-contributed guides:

  • Using AgenticAnts with CrewAI by @developer123
  • Monitoring Retrieval Quality by @ml_engineer
  • Custom Dashboards Tutorial by @data_scientist

Example Projects

Full working examples on GitHub:

  • Customer Support Bot - LangChain + OpenAI
  • Code Review Agent - Multi-agent with tools
  • Document Q&A - RAG with LlamaIndex
  • Data Analyst - AutoGen with pandas

View all examples → (opens in a new tab)

Next Steps

Start with a guide that matches your use case: