π Complete Documentation Available in the Wiki
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.
- 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
- macOS 15.0+
- Xcode 16.0+
- Swift 6
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"]
)
-
Clone the repository:
git clone git@github.com:noktirnal42/AICollaborator.git cd AICollaborator
-
Build the project:
swift build
-
Run tests to verify installation:
swift test
This section provides structured information specifically formatted for AI agents to quickly understand and interface with the AICollaborator framework.
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"))
AI agents should follow this pattern when executing tasks:
- Parse Input: Extract query, context, and constraints
- Form Plan: Create executable steps based on the parsed input
- Execute: Perform actions while maintaining context
- Validate: Check results against expectations
- Present: Return results in the expected format
// 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())
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() |
AICollaboratorAgent
: Interface for AI agentsTaskExecutable
: Protocol for task executionContextAware
: Protocol for context-aware componentsHumanInteractive
: Protocol for human interaction capabilities
For detailed API documentation, see the API Reference in the wiki.
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
-
Install required tools:
xcode-select --install
-
Set up environment variables:
export GEMINI_API_KEY="your_api_key_here"
-
Install additional dependencies:
brew install gh
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and test:
swift test
-
Submit a pull request to the
dev
branch
- Follow Swift API Design Guidelines
- Include documentation comments for all public APIs
- Write unit tests for new functionality
- Format code using SwiftFormat
Our comprehensive documentation is available in the GitHub Wiki, which includes:
- Home & Overview
- Installation and Setup
- API Reference
- Development Guidelines
- AI Agent Integration Guide
- Human-AI Collaboration
- Project Architecture
- Contributing Guidelines
- Code of Conduct
This project is licensed under the MIT License - see the LICENSE file for details.