Skip to content

Agent Registry Core Implementation

Date: 2025-04-25 Participants: AI Assistant, Rakesh Gangwar

Context

As part of Phase 1 of the Meta Agent Platform development, we needed to implement the core Agent Registry component. This registry is a fundamental part of the platform that manages agent definitions, metadata, and versioning. Initially, we considered implementing full multi-tenancy support but decided to simplify the first iteration to focus on core functionality.

Discussion

Initial Design Considerations

  1. Multi-tenancy Support:
  2. Originally planned to include workspace and tenant support
  3. Would have required additional database tables and relationships
  4. Added complexity to access control and data isolation
  5. Decision: Simplified to basic owner-based visibility for MVP

  6. Database Schema:

  7. Created two main tables: agents and agent_versions
  8. Agent table stores metadata, configuration, and current version
  9. Version table manages version history with configuration snapshots
  10. Implemented JSON Schema validation for input/output definitions

  11. Access Control:

  12. Simplified from four levels (private, workspace, tenant, public) to two (private, public)
  13. Owner-based permissions for update/delete operations
  14. Public agents visible to all users

Implementation Details

  1. Database Models:

    class Agent(Base):
        id = Column(UUID, primary_key=True)
        name = Column(String, nullable=False)
        type = Column(String, nullable=False)  # docker, api, a2a, llm, etc.
        configuration = Column(JSON)
        version = Column(String, nullable=False)
        owner_id = Column(UUID, ForeignKey("user.id"))
        visibility = Column(String)  # private, public
        input_schema = Column(JSON)
        output_schema = Column(JSON)
    

  2. Version Control:

    class AgentVersion(Base):
        id = Column(UUID, primary_key=True)
        agent_id = Column(UUID, ForeignKey("agents.id"))
        version = Column(String)  # semver
        configuration = Column(JSON)
        status = Column(String)  # draft, published, deprecated
    

  3. API Endpoints:

  4. POST /agents - Create new agent
  5. GET /agents - List agents with filtering
  6. GET /agents/{id} - Get specific agent
  7. PUT /agents/{id} - Update agent
  8. DELETE /agents/{id} - Delete agent
  9. POST /agents/{id}/versions - Create new version
  10. GET /agents/{id}/versions/{version} - Get specific version
  11. POST /agents/{id}/versions/{version}/publish - Publish version
  12. POST /agents/{id}/versions/{version}/deprecate - Deprecate version

Challenges & Solutions

  1. Database Migration Issues:
  2. Initial migration failed due to incorrect table references
  3. Solution: Fixed model imports in alembic/env.py
  4. Updated User model relationship with agents

  5. JSON Schema Validation:

  6. Implemented validation using jsonschema library
  7. Added validation at both schema and service layers
  8. Ensures input/output schemas are valid JSON Schema

  9. Version Management:

  10. Implemented semantic versioning support
  11. Created draft/publish/deprecate workflow
  12. Prevents deprecation of current active version

Decision

  1. Simplified Multi-tenancy:
  2. Removed tenant/workspace support for initial implementation
  3. Will add multi-tenancy in a future phase
  4. Focused on core agent registry functionality

  5. Version Control:

  6. Implemented full version history
  7. Support for draft versions
  8. Proper deprecation workflow

  9. Access Control:

  10. Simple private/public visibility model
  11. Owner-based permissions
  12. Public read access for shared agents

Next Steps

  1. Testing:
  2. Add comprehensive test suite
  3. Test version control edge cases
  4. Validate access control

  5. Frontend Integration:

  6. Create agent management UI
  7. Implement version control interface
  8. Add agent search and filtering

  9. Documentation:

  10. Add API documentation
  11. Create user guide
  12. Document version control workflow

  13. Future Enhancements:

  14. Implement multi-tenancy support
  15. Add workspace-level sharing
  16. Enhance search capabilities

References