A production-grade AI agentic system that automates the entire client acquisition pipeline from LinkedIn prospect discovery to signed contracts, built with modern code-first tools for maximum reliability and scalability.
- State-Aware Workflows: LangGraph manages complex multi-agent interactions with persistent state
- Type-Safe Business Logic: Pydantic ensures data integrity across all agent communications
- Intelligent Web Intelligence: Crawl4AI provides adaptive, AI-aware data extraction
- LinkedIn API Integration: Official APIs where possible, hybrid approaches where necessary
- Production-Ready Architecture: Built for 10,000+ prospects without breaking
The system consists of multiple AI agents working together:
- LinkedIn Intelligence Agent: Discovers and enriches prospect data
- AI Qualification Engine: Scores and qualifies leads using AI
- Proposal Generation Engine: Creates personalized proposals
- Conversation Management Agent: Handles outreach and responses
- Customer Support Agent: Provides ongoing support
- Python 3.11+
- PostgreSQL 15+
- Redis 7+
- Docker & Docker Compose
- OpenAI API Key
- LinkedIn API Access
-
Clone the repository
git clone <repository-url> cd linkedin-lead
-
Set up environment variables
cp .env.example .env # Edit .env with your API keys and configuration
-
Install dependencies
pip install -r requirements.txt
-
Set up database
alembic upgrade head
-
Run with Docker (recommended)
docker-compose up -d
-
Start the system
python main.py
-
Access the API
- API Documentation: http://localhost:8000/docs
- Monitoring Dashboard: http://localhost:5555
-
Monitor the workflow
tail -f logs/linkedflow.log
linkedin-lead/
├── agents/ # AI Agent implementations
│ ├── linkedin_intelligence_agent.py
│ ├── qualification_engine.py
│ ├── proposal_generator.py
│ ├── conversation_agent.py
│ └── support_agent.py
├── models/ # Pydantic data models
│ ├── __init__.py
│ ├── prospect.py
│ ├── qualification.py
│ └── proposal.py
├── workflows/ # LangGraph workflows
│ ├── __init__.py
│ └── main_workflow.py
├── api/ # FastAPI endpoints
│ ├── __init__.py
│ ├── main.py
│ └── routes/
├── database/ # Database models and migrations
│ ├── models.py
│ └── migrations/
├── templates/ # Jinja2 templates
│ ├── proposals/
│ └── emails/
├── config/ # Configuration management
│ ├── __init__.py
│ └── settings.py
├── utils/ # Utility functions
│ ├── __init__.py
│ ├── linkedin_api.py
│ └── helpers.py
├── tests/ # Test suite
│ ├── test_agents/
│ ├── test_workflows/
│ └── test_api/
├── logs/ # Application logs
├── docs/ # Documentation
├── docker-compose.yml # Docker configuration
├── Dockerfile # Docker image
├── requirements.txt # Python dependencies
├── main.py # Application entry point
└── README.md # This file
# API Keys
OPENAI_API_KEY=your_openai_api_key
LINKEDIN_API_KEY=your_linkedin_api_key
LINKEDIN_CLIENT_ID=your_linkedin_client_id
LINKEDIN_CLIENT_SECRET=your_linkedin_client_secret
# Database
POSTGRES_URL=postgresql://user:pass@localhost:5432/linkedflow
REDIS_URL=redis://localhost:6379
# Application Settings
ENVIRONMENT=production
LOG_LEVEL=INFO
MAX_PROSPECTS_PER_DAY=100
QUALIFICATION_THRESHOLD=7.0
The system provides comprehensive monitoring:
- Business Metrics: Prospect discovery rate, qualification rate, conversion rate
- Technical Metrics: System uptime, processing speed, error rates
- Real-time Dashboard: Available at http://localhost:5555
# Run all tests
pytest
# Run with coverage
pytest --cov=.
# Run specific test categories
pytest tests/test_agents/
pytest tests/test_workflows/
pytest tests/test_api/
- Daily Prospect Discovery: 50-100 qualified prospects
- Lead Qualification Rate: 15-25% of prospects become qualified leads
- Proposal Conversion Rate: 25-35% (vs industry 5-10%)
- Time to Proposal: Under 2 hours from qualification
- System Uptime: 99.9% availability
- All API keys stored securely in environment variables
- Rate limiting on all external API calls
- Input validation with Pydantic models
- Secure database connections
- Audit logging for all operations
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation in
/docs
- Review the logs in
/logs
- Multi-language support
- Advanced analytics dashboard
- Integration with CRM systems
- Mobile app for monitoring
- Advanced AI model fine-tuning
- White-label solution