AutoBE
    Preparing search index...

    Interface AutoBeDatabaseSchemaEvent

    Event fired when the Database agent generates a single database table model during the database design process.

    This event occurs when the Database agent has successfully designed and generated ONE specific database table within a business domain. The agent follows a systematic 2-step process: strategic planning (plan) and model generation (model), producing a production-ready database table model that maintains data integrity and business logic accuracy. The generated model will be reviewed by a separate review agent.

    Each event represents the completion of a single table within a namespace. Multiple events are emitted for each namespace, one per table, enabling fine-grained progress tracking and parallel generation of tables within the same business domain.

    Samchon

    interface AutoBeDatabaseSchemaEvent {
        completed: number;
        created_at: string & Format<"date-time">;
        id: string;
        metric: AutoBeFunctionCallingMetric;
        model: IModel;
        namespace: string;
        plan: string;
        step: number;
        tokenUsage: IComponent;
        total: number;
        type: "databaseSchema";
    }

    Hierarchy (View Summary)

    Index

    Properties

    completed: number

    Number of items completed.

    Tracks how many items have been successfully processed so far in the current operation. This value increments as each item is completed, providing real-time progress indication.

    The ratio of completed to total gives the completion percentage: progress = (completed / total) * 100

    created_at: string & Format<"date-time">

    Timestamp when the event was created.

    ISO 8601 formatted date-time string indicating when this event was emitted by the system. This timestamp is crucial for event ordering, performance analysis, and debugging the agent workflow execution timeline.

    Format: "YYYY-MM-DDTHH:mm:ss.sssZ" (e.g., "2024-01-15T14:30:45.123Z")

    id: string

    A unique identifier for the event.

    Function calling trial statistics for the operation.

    Records the complete trial history of function calling attempts, tracking total executions, successful completions, consent requests, validation failures, and invalid JSON responses. These metrics reveal the reliability and quality of AI agent autonomous operation with tool usage.

    Trial statistics are critical for identifying operations where agents struggle with tool interfaces, generate invalid outputs, or require multiple correction attempts through self-healing spiral loops. High failure rates indicate opportunities for system prompt optimization or tool interface improvements.

    model: IModel

    Single Prisma schema model generated based on the strategic plan.

    Contains the production-ready AST representation of a single Prisma schema model generated following the strategic plan. This model implements the planned table structure, relationships, and constraints using the AutoBeDatabase.IModel interface. The model is designed to be production-ready from the start.

    The model includes the exact table name from requirements, proper UUID primary field, foreign key relationships, business fields with appropriate types, strategic indexes, and comprehensive English-only descriptions.

    namespace: string

    Business domain namespace where this database table belongs.

    Identifies the logical business domain or functional area that this database table is part of. The namespace follows domain-driven design principles, grouping related tables together to maintain coherent schema organization and clear separation of concerns across different business areas.

    The namespace determines which Prisma schema file this table will be written to, enabling systematic development and maintainable database architecture. Each namespace typically corresponds to a major business domain such as "Actors", "Sales", or "Systematic".

    plan: string

    Strategic database design analysis and planning phase for the target table.

    Contains the AI agent's comprehensive analysis of the specific table being designed and its database design strategy. The agent evaluates the table's structure, relationships with other tables, normalization requirements, and performance considerations to create a well-architected table model that aligns with business objectives and technical best practices.

    This planning phase establishes the foundation for the single table design, ensuring proper field organization, relationship mapping, and adherence to database normalization principles while considering future scalability and maintainability requirements.

    step: number

    Iteration number of the requirements analysis this schema was generated for.

    Tracks which version of the business requirements this database schema reflects, ensuring alignment between the evolving requirements and the generated data models. As requirements change through iterations, this step number helps maintain traceability and version consistency across the database architecture development process.

    tokenUsage: IComponent

    Detailed token usage metrics for the operation.

    Contains comprehensive token consumption data including total usage, input token breakdown with cache hit rates, and output token categorization by generation type (reasoning, predictions). This component-level tracking enables precise cost analysis and identification of operations that benefit most from prompt caching or require optimization.

    Token usage directly translates to operational costs, making this metric essential for understanding the financial implications of different operation types and guiding resource allocation decisions.

    total: number

    Total number of items to process.

    Represents the complete count of operations, files, endpoints, or other entities that need to be processed in the current workflow step. This value is typically determined at the beginning of an operation and remains constant throughout the process.

    Used together with the completed field to calculate progress percentage and estimate time to completion.

    type: "databaseSchema"

    Unique identifier for the event type.

    A literal string that discriminates between different event types in the AutoBE system. This field enables TypeScript's discriminated union feature, allowing type-safe event handling through switch statements or conditional checks.

    Examples: "analyzeWrite", "databaseSchema", "interfaceOperation", "testScenario"