Python SDK for Synq - Multi-Agent AI Interaction System (Token-based access required)
Project description
Synq - Multi-Agent AI Interaction System
A powerful platform for simulating interactions between AI agents at scale. Synq enables you to create AI personas that interact with each other in isolated "synqes" to test compatibility, explore scenarios, or simulate conversations before real-world engagement.
Overview
Synq is a general-purpose multi-agent coordination system where:
- AI Agents represent different personas, personalities, or roles
- Synqes are isolated environments where agents interact
- Real-time conversations powered by OpenAI's GPT models
- Scalable architecture for running thousands of conversations in parallel
Key Features
โจ AI Agent Management
- Create unlimited AI agents with custom personalities
- Each agent maintains conversation history and context
- Powered by OpenAI's GPT models (GPT-4o-mini by default)
๐ Isolated Synqes
- Agents interact in controlled environments
- Automatic expiration with configurable TTL
- Manual synq closure when needed
๐ฌ Real-time Interactions
- Watch agents converse naturally
- Trigger responses from specific agents
- Continue conversations dynamically
๐ Structured Output Formats โญ NEW
- Define output format for agent collaboration results
- Multiple format types: Summary, Decision, JSON, Custom
- Extract structured data from conversations
- Perfect for programmatic analysis
๐ฏ Vector-Based Matching
- Semantic similarity search using embeddings
- Quick filtering before full conversations
- Efficient at scale
๐ Beautiful Web UI
- Real-time dashboard
- Live conversation viewing
- Easy agent management
Use Cases
1. Dating & Compatibility Matching
AI agents represent real people and interact to determine compatibility before meeting in person. See DATING_APP_GUIDE.md for details.
2. Team Formation
Simulate team dynamics by having AI agents represent different work styles and personalities to find optimal team combinations.
3. Customer Service Training
Create AI customers with various personalities and scenarios to train chatbots or test customer service responses.
4. Content Testing
Have AI agents represent different audience segments to test how content resonates before release.
5. Negotiation Simulation
Simulate business negotiations by having agents with different goals and strategies interact.
6. Social Network Simulation
Model social dynamics at scale by having thousands of AI agents interact in various scenarios.
Quick Start
1. Setup
# Add your OpenAI API key
echo "OPENAI_API_KEY=sk-your-key-here" > .env
# Build the application
go build -o synq cmd/synq/main.go
# Run the server
./synq
2. Open Web UI
Navigate to http://localhost:8080
3. Create Agents
The system includes 3 example agents:
- sarah_ai - Creative, empathetic personality
- marcus_ai - Ambitious, goal-oriented personality
- maya_ai - Warm, spiritually-minded personality
4. Create a Synq
- Go to "Create Synq" tab
- Add agent IDs (comma-separated)
- Set TTL (time-to-live in seconds)
- Click "Create Synq"
5. Start Interactions
- Click on a synq to open it
- Use "Start AI Conversation" for automatic multi-agent chat
- Or select an agent and send a specific message
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Web UI โ
โ (Real-time dashboard & controls) โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Server (Go) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Registry โ โ Synq Manager โ โ
โ โ (Agents) โ โ (Isolated Environments) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Vector Index โ โ Message Bus โ โ
โ โ (Embeddings) โ โ (Communication) โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenAI API โ
โ (GPT-4o-mini by default) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
API Reference
Create a Synq
curl -X POST http://localhost:8080/synq/create \
-H "Content-Type: application/json" \
-d '{
"id": "my_synq",
"agents": ["sarah_ai", "marcus_ai"],
"ttl_seconds": 3600
}'
Create a Synq with Output Format
curl -X POST http://localhost:8080/synq/create \
-H "Content-Type: application/json" \
-d '{
"id": "my_synq",
"agents": ["sarah_ai", "marcus_ai"],
"ttl_seconds": 3600,
"output_format": {
"type": "summary",
"instructions": "Focus on compatibility and shared interests"
}
}'
Generate Formatted Output
curl http://localhost:8080/synq/generate-output?synq_id=my_synq
Trigger Agent Response
curl -X POST http://localhost:8080/synq/agent-respond \
-H "Content-Type: application/json" \
-d '{
"synq_id": "my_synq",
"agent_id": "sarah_ai",
"message": "Hello! How are you?"
}'
Get Synq Messages
curl http://localhost:8080/synq/messages?id=my_synq
Close a Synq
curl -X POST http://localhost:8080/synq/close \
-H "Content-Type: application/json" \
-d '{
"synq_id": "my_synq"
}'
List All Agents
curl http://localhost:8080/agents
List All Synqes
curl http://localhost:8080/synqes
Creating Custom Agents
Edit cmd/synq/main.go to add your own agents:
customAgent := registry.NewOpenAIAgent(
"agent_id",
"agent_type",
`You are [description]. Your personality:
- Trait 1
- Trait 2
- Values: [values]
- Looking for: [goals]
When chatting, [behavioral guidelines]. Keep responses [length guidance].`,
[]float64{0.8, 0.6, 0.7}, // embedding vector
)
reg.RegisterOpenAIAgent(customAgent)
Configuration
Environment Variables
OPENAI_API_KEY- Your OpenAI API key (required)
Adjustable Settings
- Auto-cleanup interval: Edit
cmd/synq/main.goline 23 (default: 30 seconds) - OpenAI model: Edit
internal/registry/openai_agent.goline 35 (default: GPT-4o-mini) - Temperature: Edit
internal/registry/openai_agent.goline 46 (default: 0.7)
Cost Considerations
Using GPT-4o-mini (default):
- ~$0.15 per 1M input tokens
- ~$0.60 per 1M output tokens
- Average 20-message conversation: ~$0.02
- 100 conversations: ~$2.00
For production at scale, consider:
- Caching common responses
- Using fine-tuned models
- Implementing rate limiting
- Batching API calls
Features
Automatic Synq Cleanup
Synqes automatically expire after their TTL. The system checks every 30 seconds and removes expired synqes.
Manual Synq Closure
Users can manually close synqes at any time through the UI or API.
Conversation Memory
Each agent maintains full conversation history within a synq, enabling contextual responses.
Real-time Updates
The UI auto-refreshes every 5 seconds and messages refresh every 2 seconds when viewing a synq.
Tech Stack
- Backend: Go 1.25
- AI: OpenAI GPT-4o-mini
- Frontend: Vanilla JavaScript (no frameworks)
- Architecture: RESTful API
Dependencies
github.com/sashabaranov/go-openai
github.com/joho/godotenv
github.com/google/uuid
Project Structure
synq/
โโโ cmd/
โ โโโ synq/
โ โโโ main.go # Entry point, agent initialization
โโโ internal/
โ โโโ bus/ # Message bus for inter-agent communication
โ โโโ registry/ # Agent management and OpenAI integration
โ โโโ synq/ # Synq creation and lifecycle management
โ โโโ vector/ # Vector index for similarity search
โโโ ui/
โ โโโ server.go # Web UI and API endpoints
โโโ .env # Environment variables (not committed)
โโโ .gitignore
โโโ README.md
Contributing
This is a demonstration project. To extend it:
- Add new agent types in
internal/registry/ - Create custom synq behaviors in
internal/synq/ - Extend the API in
ui/server.go - Customize the UI within the HTML template
License
MIT License - Feel free to use this for any purpose.
Learn More
- Dating App Use Case Guide - Detailed example of using Synq for compatibility matching
- Output Format Guide - Complete guide to structured output generation โญ NEW
- UI Guide - Complete UI documentation
- OpenAI API Docs
Support
For questions or issues, please open a GitHub issue.
Built with โค๏ธ using Go and OpenAI
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synq_ai-0.1.0.tar.gz.
File metadata
- Download URL: synq_ai-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc5d412d3a6073c0c01904d0350b59a0387c5b048f4d261849cb8ed30b7b0274
|
|
| MD5 |
790b4e1ebaeea72d9e68721781a88c1a
|
|
| BLAKE2b-256 |
1920f6a4b4936dc2b8110320c59a44dcfb4c3113cf22c93ebb12186fa07f6dee
|
File details
Details for the file synq_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: synq_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8d48f0f04d62976d289f39eba33d50d27a929c1b012f975be5a6605f867d76
|
|
| MD5 |
c8787cdb1a880c9662928d7c03a30208
|
|
| BLAKE2b-256 |
88415f14c1c2b70b3f477f8f938773f2af74524280d5ec32f0ae15601145420d
|