Social Swarm is an innovative project that leverages AI agents to generate engaging Twitter content based on user-provided topics. This project aims to streamline social media content creation by utilizing advanced language models and a suite of specialized agents.
- Python 3.10
- Next.js 14
- TypeScript
- Tailwind CSS
- Modal
- OpenAI API
- Together API
- Perplexity AI API
- Composio API
The main objective of Social Swarm is to create a system that can:
- Accept a topic from the user
- Utilize multiple AI agents to gather relevant information
- Generate engaging tweets based on the collected data
- Perform a groundedness check to ensure the quality of the generated content
- Provide an easy-to-use web interface for interacting with the system
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/sailingsf/agent_ai_hackathon.git cd social-swarm -
Set up the backend:
cd agents python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt -
Set up environment variables: Create a
.envfile in theagentsdirectory and add the following variables:TOGETHER_API_KEY=your_together_api_key OPENAI_LOCAL_API_KEY=your_openai_api_key PERPLEXITY_API_KEY=your_perplexity_api_key COMPOSIO_API_KEY=your_composio_api_key UPSTAGE_API_KEY=your_upstage_api_key -
Set up the frontend:
cd ../ui npm install -
Run the backend:
cd ../agents modal deploy main.py -
Run the frontend:
cd ../ui npm run dev -
Open your browser and navigate to
http://localhost:3000to use the application.
The project is divided into two main parts:
-
Backend (agents):
- Contains the AI agents and tools for generating content
- Implements the Modal serverless functions for API endpoints
- Handles integration with various AI services
-
Frontend (ui):
- Next.js application for the user interface
- Allows users to input topics and view generated tweets
Key files and directories:
agents/
├── main.py # Main Modal app and API endpoints
├── run_agents.py # Orchestrates the AI agents
├── agent_class.py # Defines the Agent class
├── tools/ # Contains various tools used by agents
└── requirements.txt # Python dependencies
ui/
├── app/ # Next.js app directory
│ ├── page.tsx # Main page component
│ └── types/types.ts # TypeScript type definitions
├── package.json # Node.js dependencies
└── tailwind.config.ts # Tailwind CSS configuration
- Start the application and navigate to the web interface.
- Enter a topic in the input field.
- Click "Get started" to generate tweets.
- View the generated tweets and their associated information.
Contributions to Social Swarm are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.