Skip to content

groovy-web/groovy-web-ai-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Groovy Web AI Agents

Built by Groovy Web License: MIT

Production-ready AI agent configurations for Groovy Web ecosystem

πŸš€ Overview

A comprehensive collection of AI agent configurations, prompts, and orchestration patterns for building intelligent web applications. This repository provides reusable agent templates for various use cases including content generation, data analysis, code review, and customer support.

✨ Features

  • Modular Agent System: Pre-configured agent templates for common tasks
  • Multi-Agent Orchestration: Patterns for agent collaboration and communication
  • Prompt Engineering: Battle-tested prompts with examples
  • Integration Ready: Works seamlessly with LangChain, OpenAI, and Anthropic APIs
  • TypeScript Support: Full type definitions for agent configurations
  • Testing Suite: Unit and integration tests for agent behaviors

πŸ“¦ Installation

npm install @groovy-web/ai-agents
# or
yarn add @groovy-web/ai-agents
# or
pnpm add @groovy-web/ai-agents

🎯 Quick Start

import { ContentAgent, AnalysisAgent } from '@groovy-web/ai-agents';

// Initialize a content generation agent
const contentAgent = new ContentAgent({
  model: 'gpt-4',
  temperature: 0.7,
  maxTokens: 2000,
});

const blogPost = await contentAgent.generate({
  topic: 'The Future of Web Development',
  tone: 'professional',
  length: 'medium',
});

console.log(blogPost);

πŸ€– Available Agents

ContentAgent

Generate blog posts, social media content, marketing copy, and documentation.

import { ContentAgent } from '@groovy-web/ai-agents';

const agent = new ContentAgent();
const content = await agent.generateBlogPost({
  title: 'Building Scalable APIs',
  keywords: ['REST', 'GraphQL', 'Performance'],
});

AnalysisAgent

Analyze data, generate reports, and provide insights.

import { AnalysisAgent } from '@groovy-web/ai-agents';

const agent = new AnalysisAgent();
const insights = await agent.analyzeData({
  data: userData,
  metrics: ['engagement', 'retention', 'conversion'],
});

CodeReviewAgent

Review code for best practices, security, and performance issues.

import { CodeReviewAgent } from '@groovy-web/ai-agents';

const agent = new CodeReviewAgent();
const review = await agent.reviewCode({
  language: 'typescript',
  code: sourceCode,
  rules: ['security', 'performance', 'style'],
});

SupportAgent

Handle customer support queries with context-aware responses.

import { SupportAgent } from '@groovy-web/ai-agents';

const agent = new SupportAgent({
  knowledgeBase: faqData,
  companyInfo: companyDetails,
});

const response = await agent.handleQuery({
  query: userQuery,
  context: ticketHistory,
});

πŸ”§ Configuration

Base Agent Options

interface AgentConfig {
  model: string;              // Model identifier (gpt-4, claude-3, etc.)
  temperature?: number;       // 0-1, default: 0.7
  maxTokens?: number;         // Max response tokens
  apiKey?: string;            // API key (or use env variable)
  timeout?: number;           // Request timeout in ms
  retries?: number;           // Retry attempts
  memory?: boolean;           // Enable conversation memory
}

Custom Agent Creation

import { createAgent } from '@groovy-web/ai-agents';

const customAgent = createAgent({
  name: 'SEOOptimizer',
  systemPrompt: 'You are an SEO expert...',
  tools: [keywordAnalyzer, contentOptimizer],
  config: {
    model: 'claude-3-opus',
    temperature: 0.5,
  },
});

🌐 Multi-Agent Patterns

Sequential Execution

import { AgentOrchestrator } from '@groovy-web/ai-agents';

const orchestrator = new AgentOrchestrator();

const result = await orchestrator.sequential([
  { agent: researchAgent, input: topic },
  { agent: contentAgent, input: '$previous.research' },
  { agent: seoAgent, input: '$previous.content' },
]);

Parallel Execution

const results = await orchestrator.parallel([
  { agent: translatorAgent, input: text, locale: 'es' },
  { agent: summarizerAgent, input: text },
  { agent: sentimentAgent, input: text },
]);

Hierarchical Orchestrator

const manager = new ManagerAgent({
  subAgents: [researcher, writer, editor],
  decisionStrategy: 'consensus', // or 'majority', 'manager-decides'
});

const output = await manager.coordinate({
  task: 'Create technical documentation',
  requirements: docs,
});

πŸ§ͺ Testing

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run specific test suite
npm test -- content-agent.test.ts

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

πŸ“„ License

MIT License - see LICENSE for details.

πŸ”— Links

⭐ Show Your Support

Give us a star on GitHub if you find this project helpful!


Made with ❀️ by the Groovy Web Team


Related Repositories

Explore more open-source tools from Groovy Web:

About

Production-ready AI agent configurations and orchestration patterns

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors