Skip to content

noktirnal42/AICollaborator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AICollaborator Logo

AI Collaborator

Swift 6 macOS 15+ License: MIT

πŸ“š Complete Documentation Available in the Wiki

Overview

AI Collaborator is a Swift-based framework designed to facilitate seamless collaboration between AI agents and human users. It provides a structured environment for AI agents to contribute to software development, assist with problem-solving, and automate repetitive tasks.

Key Features

  • Flexible AI Model Integration: Connect to any Ollama model, with model selection and management
  • GitHub Repository Integration: Work with any GitHub repository, not limited to specific projects
  • Context Preservation: Maintains conversation and task history for improved collaboration
  • Code Analysis: Tools for AI agents to understand, modify, and generate code
  • Multi-agent Orchestration: Coordinate multiple specialized AI agents
  • Human-AI Collaboration Framework: Structured protocols for effective teamwork

Installation

Prerequisites

  • macOS 15.0+
  • Xcode 16.0+
  • Swift 6

Using Swift Package Manager

Add AICollaborator as a dependency in your Package.swift file:

dependencies: [
    .package(url: "https://github.com/noktirnal42/AICollaborator.git", from: "0.1.0")
]

Then include it in your target:

.target(
    name: "YourTarget",
    dependencies: ["AICollaborator"]
)

Manual Installation

  1. Clone the repository:

    git clone git@github.com:noktirnal42/AICollaborator.git
    cd AICollaborator
  2. Build the project:

    swift build
  3. Run tests to verify installation:

    swift test

Quick Start Guide for AI Agents

This section provides structured information specifically formatted for AI agents to quickly understand and interface with the AICollaborator framework.

Initial Connection

import AICollaborator

// Initialize the collaborator instance
let collaborator = AICollaborator()

// Connect AI agent with required credentials
collaborator.connect(agentType: .llm, 
                     credentials: AICredentials(apiKey: "YOUR_API_KEY"))

Task Execution Pattern

AI agents should follow this pattern when executing tasks:

  1. Parse Input: Extract query, context, and constraints
  2. Form Plan: Create executable steps based on the parsed input
  3. Execute: Perform actions while maintaining context
  4. Validate: Check results against expectations
  5. Present: Return results in the expected format

Sample Agent Integration

// Example of an AI agent implementing the Collaborator protocol
struct MyAIAgent: AICollaboratorAgent {
    func processTask(_ task: AITask) -> AITaskResult {
        // Task processing logic
        return AITaskResult(status: .completed, output: "Task result")
    }
    
    func provideCapabilities() -> [AICapability] {
        return [.codeGeneration, .textAnalysis]
    }
}

// Register with the collaborator
collaborator.register(agent: MyAIAgent())

API Reference Overview

Core Components

Component Purpose Key Methods
AICollaborator Main entry point connect(), register(), execute()
AITask Task representation parseFromInput(), validate()
AIAgent Agent protocol processTask(), provideCapabilities()
AIContext Context management store(), retrieve(), update()

Key Protocols

  • AICollaboratorAgent: Interface for AI agents
  • TaskExecutable: Protocol for task execution
  • ContextAware: Protocol for context-aware components
  • HumanInteractive: Protocol for human interaction capabilities

For detailed API documentation, see the API Reference in the wiki.

Project Structure

AICollaborator/
β”œβ”€β”€ Sources/
β”‚   β”œβ”€β”€ AICollaboratorApp/        # Main application code
β”‚   β”‚   β”œβ”€β”€ Core/                 # Core functionality
β”‚   β”‚   β”œβ”€β”€ Agents/               # Agent implementations
β”‚   β”‚   β”œβ”€β”€ Tasks/                # Task definitions
β”‚   β”‚   └── Utils/                # Utility functions
β”‚   └── Resources/                # Resource files
β”œβ”€β”€ Tests/                        # Test suite
β”œβ”€β”€ Documentation/                # Detailed documentation
β”œβ”€β”€ Examples/                     # Example implementations
└── .github/                      # GitHub configuration

Development Setup

Environment Setup

  1. Install required tools:

    xcode-select --install
  2. Set up environment variables:

    export GEMINI_API_KEY="your_api_key_here"
  3. Install additional dependencies:

    brew install gh

Development Workflow

  1. Create a feature branch:

    git checkout -b feature/your-feature-name
  2. Make your changes and test:

    swift test
  3. Submit a pull request to the dev branch

Coding Standards

  • Follow Swift API Design Guidelines
  • Include documentation comments for all public APIs
  • Write unit tests for new functionality
  • Format code using SwiftFormat

Documentation

Our comprehensive documentation is available in the GitHub Wiki, which includes:

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

AI Collaborator: A Swift framework for AI agent collaboration and task management

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages