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
- Multi-tenancy Support:
- Originally planned to include workspace and tenant support
- Would have required additional database tables and relationships
- Added complexity to access control and data isolation
-
Decision: Simplified to basic owner-based visibility for MVP
-
Database Schema:
- Created two main tables:
agentsandagent_versions - Agent table stores metadata, configuration, and current version
- Version table manages version history with configuration snapshots
-
Implemented JSON Schema validation for input/output definitions
-
Access Control:
- Simplified from four levels (private, workspace, tenant, public) to two (private, public)
- Owner-based permissions for update/delete operations
- Public agents visible to all users
Implementation Details
-
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) -
Version Control:
-
API Endpoints:
POST /agents- Create new agentGET /agents- List agents with filteringGET /agents/{id}- Get specific agentPUT /agents/{id}- Update agentDELETE /agents/{id}- Delete agentPOST /agents/{id}/versions- Create new versionGET /agents/{id}/versions/{version}- Get specific versionPOST /agents/{id}/versions/{version}/publish- Publish versionPOST /agents/{id}/versions/{version}/deprecate- Deprecate version
Challenges & Solutions
- Database Migration Issues:
- Initial migration failed due to incorrect table references
- Solution: Fixed model imports in alembic/env.py
-
Updated User model relationship with agents
-
JSON Schema Validation:
- Implemented validation using jsonschema library
- Added validation at both schema and service layers
-
Ensures input/output schemas are valid JSON Schema
-
Version Management:
- Implemented semantic versioning support
- Created draft/publish/deprecate workflow
- Prevents deprecation of current active version
Decision
- Simplified Multi-tenancy:
- Removed tenant/workspace support for initial implementation
- Will add multi-tenancy in a future phase
-
Focused on core agent registry functionality
-
Version Control:
- Implemented full version history
- Support for draft versions
-
Proper deprecation workflow
-
Access Control:
- Simple private/public visibility model
- Owner-based permissions
- Public read access for shared agents
Next Steps
- Testing:
- Add comprehensive test suite
- Test version control edge cases
-
Validate access control
-
Frontend Integration:
- Create agent management UI
- Implement version control interface
-
Add agent search and filtering
-
Documentation:
- Add API documentation
- Create user guide
-
Document version control workflow
-
Future Enhancements:
- Implement multi-tenancy support
- Add workspace-level sharing
- Enhance search capabilities