AI Agents

Learn how to manage AI agents in the NextCoder platform

Overview

AI agents are the core intelligence behind NextCoder's automation capabilities. Each agent can be configured with different models and prompts to perform specific tasks within a workspace.

Supported Models

NextCoder supports multiple AI models:

  • Claude Sonnet (Anthropic)
  • Claude Opus (Anthropic)
  • Gemini Pro (Google)
  • ChatGPT (OpenAI)
  • Mistral (Mistral AI)
  • Llama (Meta)

Creating an AI Agent

AI agents can be created through the dashboard UI or via the API.

// Create a new AI agent via API
const response = await fetch('/api/agents', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    workspaceId: 'workspace-123',
    modelName: 'claude-sonnet',
    config: {
      prompt: 'Generate a React component that displays a todo list',
      temperature: 0.7
    }
  }),
});

const agent = await response.json();

Agent API Endpoints

MethodEndpointDescription
GET/api/agentsList all agents
POST/api/agentsCreate a new agent
GET/api/agents/{id}Get agent details
PUT/api/agents/{id}Update an agent
DELETE/api/agents/{id}Delete an agent

Agent Data Model

interface AI_Agent {
  id: string;
  workspaceId: string;
  modelName: string;
  configJson: string; // JSON string of configuration
  createdAt: Date;
  updatedAt: Date;
}