This system allows two different AI agents (GPT-4o and Sonnet) to share files and collaborate on projects.
-
Make sure you have a
config.yamlfile with your API keys:openai-api-key: "your-openai-api-key" anthropic-api-key: "your-anthropic-api-key"
-
Run the start_aider.bat script to launch both agents:
start_aider.bat -
To run only one specific agent:
start_aider.bat gpt-4oor
start_aider.bat sonnet
The system creates three directories:
agent_gpt4o/: Working directory for the GPT-4o agentagent_sonnet/: Working directory for the Sonnet agentshared_workspace/: Directory where files are shared between agents
Each directory serves a specific purpose in the collaboration workflow:
-
Agent-specific directories (
agent_gpt4o/andagent_sonnet/):- Private workspaces for each AI model
- Files created or modified here are automatically shared
- Each agent only sees files in its own directory and the shared workspace
- Useful for model-specific tasks before sharing with other agents
-
Shared workspace (
shared_workspace/):- Central repository for all shared files
- Contains a
metadata.jsonfile tracking ownership and history - Acts as the "handoff point" between agents
- All agents can access files here
Files are automatically shared when they are modified in an agent's directory. You can also manually share files by:
- Creating or modifying a file in an agent's directory
- The file will automatically be copied to the shared workspace
- The other agent can access the file from the shared workspace
The system maintains a metadata.json file in the shared workspace that tracks:
- Which agent owns each file
- When files were last modified
- Which agents have accessed each file
When working with an agent in the Aider chat interface, you can use these commands:
To explicitly share a file with the other agent:
!share filename.txt
This command:
- Copies the file from your agent's directory to the shared workspace
- Updates the metadata to mark you as the owner
- Makes the file available to other agents
Example usage:
User: Can you share the database schema with the other agent?
Agent: I'll share it right away.
!share database_schema.sql
File database_schema.sql shared successfully.
To request a file from the shared workspace:
!request filename.txt
This command:
- Copies the file from the shared workspace to your agent's directory
- Updates the metadata to record that you've accessed the file
- Makes the file available in your agent's context
Example usage:
User: I need you to review the API documentation the other agent created.
Agent: Let me get that file.
!request api_documentation.md
File api_documentation.md retrieved successfully.
To see all files available in the shared workspace:
!list-shared
This command:
- Shows all files in the shared workspace
- Displays ownership information
- Shows when files were last modified
Example usage:
User: What files are available in the shared workspace?
Agent: Let me check.
!list-shared
Shared files:
- database_schema.sql (Owner: gpt-4o, Last modified: 2023-06-15 14:30)
- api_documentation.md (Owner: sonnet, Last modified: 2023-06-15 15:45)
This system enables several powerful workflows when working with multiple AI models:
Assign different parts of a project to the model best suited for the task:
- Use GPT-4o for creative coding and complex problem-solving
- Use Claude Sonnet for documentation, explanations, and code reviews
- Share results between models to combine their strengths
- Have one agent write code in its directory
- The code is automatically shared to the shared workspace
- Request the other agent to review the code
- The reviewing agent can suggest improvements and share back the updated version
- Develop code with one agent
- Share the completed code with the documentation specialist agent
- The second agent creates comprehensive documentation
- Both code and documentation are available in the shared workspace
- Start a project with one agent
- Share progress with the second agent for a fresh perspective
- Continue development with either agent based on project needs
- Maintain a complete history of changes in the shared workspace
If you encounter issues with file sharing:
- Check that both agents are running
- Verify that the directories exist
- Check the metadata.json file for file status
- Restart the agents if necessary
You can share and request multiple files by using multiple commands:
!share file1.py
!share file2.py
!share file3.py
For larger projects, consider creating subdirectories within each agent's directory:
agent_gpt4o/frontend/for frontend codeagent_sonnet/documentation/for documentation files
The file watcher will still detect changes and share files appropriately.