Skip to content

# Prototype Overview

This page provides an overview of the prototype implementations of the UIM Protocol. These prototypes demonstrate the feasibility and functionality of the protocol in real-world scenarios.

## Purpose of Prototypes

The UIM Protocol prototypes serve several important purposes:

1. Proof of Concept: Demonstrating that the protocol can be implemented and works as designed.
2. Reference Implementation: Providing a reference for developers implementing the protocol in their own systems.
3. Testing Ground: Allowing for experimentation and testing of protocol features and extensions.
4. Feedback Collection: Gathering feedback from early adopters to improve the protocol.
5. Interoperability Testing: Ensuring different implementations can work together seamlessly.

## Available Prototypes

The UIM Protocol project currently includes the following prototype implementations:

### 1. Discovery Service

The Discovery Service is a centralized implementation of the UIM Protocol's discovery mechanism. It allows AI agents to discover web services and their intents through a centralized registry.

Key Features: - Service registration and management - Intent registration and discovery - Policy management - PAT issuance

Technologies: - Node.js - Express - MongoDB - JWT for PAT implementation

### 2. Mock Agent

The Mock Agent is a simulated AI agent that implements the UIM Protocol. It can discover services, request PATs, and execute intents.

Key Features: - Service discovery using DNS TXT records and agents.json - Policy retrieval and signing - PAT acquisition - Intent discovery and execution

Technologies: - Python - Requests library - Cryptography library - Command-line interface

### 3. Mock Webservice

The Mock Webservice is a simulated web service that implements the UIM Protocol. It exposes intents, issues PATs, and processes intent execution requests.

Key Features: - Intent definition and exposure - Policy definition and enforcement - PAT issuance - Intent execution

Technologies: - Node.js - Express - JWT for PAT implementation - In-memory data store

## Architecture Overview

The prototype implementations follow the architecture defined in the UIM Protocol specification. The following diagram illustrates how the prototypes interact with each other:

    +----------------+       Discovery       +------------------+
    |                |<-------------------->|                  |
    |   Mock Agent   |                      | Discovery Service |
    |                |<-------------------->|                  |
    +----------------+       Registration    +------------------+
            ^                                         ^
            |                                         |
            | Intent Execution                        | Registration
            |                                         |
            v                                         v
    +----------------+                      +------------------+
    |                |                      |                  |
    | Mock Webservice|<-------------------->| Other Webservices|
    |                |    Interoperability  |                  |
    +----------------+                      +------------------+

## Getting Started with Prototypes

To get started with the UIM Protocol prototypes, follow these steps:

1. Clone the UIM Protocol repository:

       git clone https://github.com/synaptiai/uim-protocol.git
       cd uim-protocol

2. Set up the Discovery Service:

       cd discovery-service
       npm install
       npm start

3. Set up the Mock Webservice:

       cd mock-webservice
       npm install
       npm start

4. Set up the Mock Agent:

       cd mock-agent
       pip install -r requirements.txt
       python mock_agent.py

5. Follow the specific instructions in each prototype's documentation for detailed usage.

## Example Workflow

Here's an example workflow demonstrating how the prototypes work together:

1. The Mock Webservice registers with the Discovery Service, providing its intents and policy.
2. The Mock Agent queries the Discovery Service to find services that match its requirements.
3. The Mock Agent retrieves the policy from the Mock Webservice.
4. The Mock Agent signs the policy and requests a PAT from the Mock Webservice.
5. The Mock Webservice verifies the signature and issues a PAT to the Mock Agent.
6. The Mock Agent executes an intent on the Mock Webservice using the PAT.
7. The Mock Webservice verifies the PAT, processes the intent, and returns the result.

## Extending the Prototypes

The UIM Protocol prototypes are designed to be extensible. Here are some ways you can extend them:

1. Add New Intents: Define new intents in the Mock Webservice to expose additional functionality.
2. Implement New Policies: Create more complex policies with different constraints and duties.
3. Add Authentication Methods: Implement additional authentication methods for PAT issuance.
4. Create New Agents: Develop specialized agents for specific use cases.
5. Integrate with Real Services: Connect the prototypes to real web services.

## Contributing to Prototypes

We welcome contributions to the UIM Protocol prototypes. If you'd like to contribute, please follow these steps:

1. Fork the repository on GitHub.
2. Create a new branch for your feature or bug fix.
3. Make your changes and write tests.
4. Submit a pull request with a clear description of your changes.

For more information on contributing, see the Contributing Guide.

## Future Developments

The UIM Protocol prototypes are continuously evolving. Future developments include:

1. Decentralized Discovery: Implementing a fully decentralized discovery mechanism.
2. Enhanced Security: Adding more robust security features.
3. Performance Optimizations: Improving the performance of the prototypes.
4. Additional Language Implementations: Creating implementations in other programming languages.
5. Real-world Integrations: Integrating with popular web services and AI platforms.

For more information on the roadmap, see the Roadmap.