A modular, agent-based system for crafting engaging LinkedIn posts. This project uses Google ADK (Agent Development Kit) to orchestrate multiple specialized sub-agents, ensuring a polished, professional final post — complete with behind-the-scenes storytelling, optimized hashtags, and an optional image.
I launched this project after noticing a clear pattern - While more people are sharing on LinkedIn, many posts end up blending together, often carrying that generic, AI-generated feel. If AI is already part of the process, why not build a tool that empowers users to create posts that stand out and authentically reflect their unique voice and goals?
This project implements a multi-phase, agent-based workflow to do just that:
✅ Phase 1: Gather post intent and additional details
✅ Phase 2: Generate a compelling behind story
✅ Phase 3: Suggest relevant hashtags
✅ Phase 4: Craft a complete post
✅ Phase 5: (Optional) Generate a prompt-based image
All phases are orchestrated by a manager agent, delegating to sub-agents for each specialized task.
.
├── .gitignore
├── .vscode/settings.json
├── LICENSE
├── README.md
├── requirements.txt
└── linkedin_post_agent/
├── .env
├── agent.py
├── constants.py
├── prompt.py
└── sub_agents/
├── story_agent/
│ ├── agent.py
│ └── prompt.py
├── hashtag_agent/
│ ├── agent.py
│ └── prompt.py
├── post_agent/
│ ├── agent.py
│ └── prompt.py
└── image_agent/
├── agent.py
├── prompt.py
└── tools/create_image.py
Follow these steps to get the project up and running:
# Clone this repository
git clone https://github.com/sujeetgund/linkedin-post-generator-agent.git
cd linkedin-post-generator-agent
# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the linkedin_post_agent/ directory based on the provided .env.example file:
cd linkedin_post_agent
cp .env.example .envThis project uses the Google Gemini API for generating content and images.
-
Visit the Google AI Studio.
-
Sign in with your Google account.
-
Click "Create API key" and copy it.
-
Add your Gemini API key to
.env:GOOGLE_API_KEY=your_gemini_api_key
To enable image uploads, you'll need to set up Cloudinary credentials:
-
Sign up for a free Cloudinary account if you don't have one.
-
After logging in, go to your Cloudinary Dashboard.
-
Locate your Cloud name, API Key, and API Secret under the "Account Details" section.
-
Add these values to your
.envfile:CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
These credentials allow the agent to upload and manage images for your LinkedIn posts.
To start the agent system, run:
python -m linkedin_post_agentThis command launches the FastAPI server, allowing you to generate LinkedIn posts through an interactive, agent-driven workflow.
For development and debugging, you can also launch the Google ADK developer UI with:
adk webHere’s what you can expect from the interaction:
- Manager agent asks: "What is the intention of your post?"
- You provide a topic and optional details.
- Story Agent generates an engaging backstory.
- Hashtag Agent suggests relevant hashtags.
- Post Agent crafts the complete LinkedIn post.
- Optionally, Image Agent can create a relevant image for your post.
- The final post (and image) are presented to you for review.
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the Apache 2.0 License.
- Built with the power of Google Gemini API.
- Orchestrated using Google ADK.