Create AgentType entity and CRUD operations #24

Closed
opened 2025-12-29 23:47:12 +00:00 by cardosofelipe · 0 comments

Description

Implement the AgentType entity representing agent templates.

Requirements

Entity Fields

class AgentType(Base):
    id: UUID
    name: str  # e.g., "Product Owner", "Backend Engineer"
    slug: str  # URL-friendly
    description: str
    expertise: List[str]  # JSON array of expertise areas
    personality_prompt: str  # System prompt defining personality

    # Model Configuration
    primary_model: str  # e.g., "claude-opus-4.5"
    fallback_models: List[str]  # JSON array, in order of preference
    model_params: dict  # temperature, max_tokens, etc.

    # MCP Configuration
    mcp_servers: List[str]  # Which MCP servers this agent can use
    tool_permissions: dict  # Tool-level permissions

    # Metadata
    is_active: bool
    created_at: datetime
    updated_at: datetime

CRUD Operations

  • create(db, obj_in: AgentTypeCreate) -> AgentType
  • get(db, id: UUID) -> Optional[AgentType]
  • get_by_slug(db, slug: str) -> Optional[AgentType]
  • get_all_active(db) -> List[AgentType]
  • update(db, db_obj: AgentType, obj_in: AgentTypeUpdate) -> AgentType
  • delete(db, id: UUID) -> None (soft delete via is_active)

Seed Data

Create initial agent types:

  • Product Owner
  • Business Analyst
  • Solutions Architect
  • Backend Engineer
  • Frontend Engineer
  • QA Engineer
  • DevOps Engineer

Tests

  • CRUD operations
  • Model configuration validation
  • MCP server permissions

Acceptance Criteria

  • Model defined with all fields
  • Migration created
  • CRUD operations implemented
  • Pydantic schemas
  • Seed data script
  • Unit tests with >90% coverage

Technical Notes

  • Reference: ADR-002 (Agent orchestration)
  • Reference: SPIKE-002 (Agent orchestration research)
  • model_params should be validated against known LLM parameters

Assignable To

backend-engineer agent

## Description Implement the AgentType entity representing agent templates. ## Requirements ### Entity Fields ```python class AgentType(Base): id: UUID name: str # e.g., "Product Owner", "Backend Engineer" slug: str # URL-friendly description: str expertise: List[str] # JSON array of expertise areas personality_prompt: str # System prompt defining personality # Model Configuration primary_model: str # e.g., "claude-opus-4.5" fallback_models: List[str] # JSON array, in order of preference model_params: dict # temperature, max_tokens, etc. # MCP Configuration mcp_servers: List[str] # Which MCP servers this agent can use tool_permissions: dict # Tool-level permissions # Metadata is_active: bool created_at: datetime updated_at: datetime ``` ### CRUD Operations - `create(db, obj_in: AgentTypeCreate) -> AgentType` - `get(db, id: UUID) -> Optional[AgentType]` - `get_by_slug(db, slug: str) -> Optional[AgentType]` - `get_all_active(db) -> List[AgentType]` - `update(db, db_obj: AgentType, obj_in: AgentTypeUpdate) -> AgentType` - `delete(db, id: UUID) -> None` (soft delete via is_active) ### Seed Data Create initial agent types: - Product Owner - Business Analyst - Solutions Architect - Backend Engineer - Frontend Engineer - QA Engineer - DevOps Engineer ### Tests - CRUD operations - Model configuration validation - MCP server permissions ## Acceptance Criteria - [ ] Model defined with all fields - [ ] Migration created - [ ] CRUD operations implemented - [ ] Pydantic schemas - [ ] Seed data script - [ ] Unit tests with >90% coverage ## Technical Notes - Reference: ADR-002 (Agent orchestration) - Reference: SPIKE-002 (Agent orchestration research) - `model_params` should be validated against known LLM parameters ## Assignable To backend-engineer agent
cardosofelipe added the backenddatabasephase-1 labels 2025-12-29 23:49:58 +00:00
Sign in to join this conversation.