{"id":31533453,"url":"https://github.com/gabrielm3/customer-intelligence-hub","last_synced_at":"2026-04-16T14:02:47.314Z","repository":{"id":317767937,"uuid":"1068650427","full_name":"Gabrielm3/customer-intelligence-hub","owner":"Gabrielm3","description":"An intelligent Customer Relationship Management system powered by AI agents, designed to analyze customer data, create targeted marketing campaigns, and provide actionable business insights","archived":false,"fork":false,"pushed_at":"2025-10-02T21:58:46.000Z","size":7457,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-02T23:37:08.315Z","etag":null,"topics":["docker","docker-compose","langgraph","langsmith","mcp-server","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gabrielm3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T17:45:26.000Z","updated_at":"2025-10-02T21:58:49.000Z","dependencies_parsed_at":"2025-10-02T23:47:14.405Z","dependency_job_id":null,"html_url":"https://github.com/Gabrielm3/customer-intelligence-hub","commit_stats":null,"previous_names":["gabrielm3/customer-intelligence-hub"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Gabrielm3/customer-intelligence-hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gabrielm3%2Fcustomer-intelligence-hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gabrielm3%2Fcustomer-intelligence-hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gabrielm3%2Fcustomer-intelligence-hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gabrielm3%2Fcustomer-intelligence-hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gabrielm3","download_url":"https://codeload.github.com/Gabrielm3/customer-intelligence-hub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gabrielm3%2Fcustomer-intelligence-hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266909,"owners_count":25958733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","langgraph","langsmith","mcp-server","python"],"created_at":"2025-10-04T04:54:57.629Z","updated_at":"2025-10-04T04:55:01.316Z","avatar_url":"https://github.com/Gabrielm3.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customer Intelligence Hub - CRM\r\n\r\nAn intelligent Customer Relationship Management system powered by AI agents, designed to analyze customer data, create targeted marketing campaigns, and provide actionable business insights.\r\n\r\n## Overview\r\n\r\nCustomer Intelligence Hub is an AI-powered system that combines customer data analysis with automated marketing capabilities. It uses LangGraph for agent orchestration, PostgreSQL for data storage, and Model Context Protocol (MCP) for tool integration.\r\n\r\n## Architecture\r\n\r\n```mermaid\r\ngraph TB\r\n    A[👤 User] --\u003e B[🤖 Neo AI Agent]\r\n    B --\u003e C[🔧 MCP Tools Layer]\r\n    \r\n    C --\u003e D[🗄️ PostgreSQL Server]\r\n    C --\u003e E[📧 Marketing Server]\r\n    C --\u003e F[💬 Slack Server]\r\n    \r\n    D --\u003e G[(📊 Customer Database)]\r\n    G --\u003e H[👥 Customers]\r\n    G --\u003e I[💰 Transactions]\r\n    G --\u003e J[📈 RFM Analysis]\r\n    G --\u003e K[🎯 Campaigns]\r\n    \r\n    E --\u003e L[📝 Campaign Creation]\r\n    E --\u003e M[✉️ Email Automation]\r\n    \r\n    F --\u003e N[🔔 Team Notifications]\r\n    F --\u003e O[💡 Insights Sharing]\r\n    \r\n    B --\u003e P[📊 LangSmith Tracking]\r\n    \r\n```\r\n\r\n## Key Features\r\n\r\n- **AI-Powered Customer Analysis**: Automated RFM (Recency, Frequency, Monetary) analysis\r\n- **Smart Marketing Campaigns**: Create and manage targeted campaigns based on customer segments\r\n- **Real-time Data Queries**: Natural language interface to query customer and sales data\r\n- **Slack Integration**: Share insights and updates with your team automatically\r\n- **Comprehensive Tracking**: Full observability with LangSmith integration\r\n\r\n## Benefits\r\n\r\n- **🎯 Targeted Marketing**: Identify high-value customers and create personalized campaigns\r\n- **📊 Data-Driven Insights**: Get instant answers about customer behavior and sales performance\r\n- **⚡ Automation**: Reduce manual work with automated campaign creation and email sending\r\n- **👥 Team Collaboration**: Keep everyone informed with Slack notifications\r\n- **📈 Performance Tracking**: Monitor all AI interactions and decisions with LangSmith\r\n- **🔄 Scalable Architecture**: Built with modern tools for enterprise-grade performance\r\n\r\n## Quick Start\r\n\r\n### Prerequisites\r\n\r\n- Docker and Docker Compose\r\n- OpenAI API Key\r\n- LangSmith API Key (optional, for tracking)\r\n- Slack Bot Token (optional, for Slack integration)\r\n\r\n### Running with Docker (Recommended)\r\n\r\n1. **Clone the repository**\r\n   ```bash\r\n   git clone https://github.com/Gabrielm3/customer-intelligence-hub\r\n   cd customer-intelligence-hub\r\n   ```\r\n\r\n2. **Configure environment variables**\r\n   ```bash\r\n   cp .env.example .env\r\n   # Edit .env with your API keys\r\n   ```\r\n\r\n3. **Start the system**\r\n   ```bash\r\n   docker-compose up --build -d\r\n   ```\r\n\r\n4. **Generate and import sample data**\r\n   ```bash\r\n   # Generate CSV files from raw data (run once)\r\n   docker-compose exec crm-agent bash -c \"cd database \u0026\u0026 uv run python generate_data_tables.py\"\r\n   \r\n   # Import CSV files to database\r\n   docker-compose exec crm-agent bash -c \"cd database \u0026\u0026 uv run python import_data.py\"\r\n   ```\r\n\r\n5. **Start the interactive CLI**\r\n   ```bash\r\n   docker-compose exec crm-agent uv run python cli/interactive_cli.py\r\n   ```\r\n\r\n### Running Locally\r\n\r\n1. **Install dependencies**\r\n   ```bash\r\n   uv sync\r\n   ```\r\n\r\n2. **Set up PostgreSQL database**\r\n   ```bash\r\n   # Start PostgreSQL locally or use Docker\r\n   docker run -d --name postgres \\\r\n     -e POSTGRES_DB=crm_database \\\r\n     -e POSTGRES_USER=crm_user \\\r\n     -e POSTGRES_PASSWORD=crm_password \\\r\n     -p 5432:5432 postgres:15-alpine\r\n   ```\r\n\r\n3. **Configure environment**\r\n   ```bash\r\n   cp .env.example .env\r\n   # Update DATABASE_URL for local PostgreSQL\r\n   ```\r\n\r\n4. **Initialize database**\r\n   ```bash\r\n   cd database\r\n   # Generate CSV files from raw data\r\n   uv run python generate_data_tables.py\r\n   # Import to database\r\n   uv run python import_data.py\r\n   ```\r\n\r\n5. **Run the CLI**\r\n   ```bash\r\n   uv run python cli/interactive_cli.py\r\n   ```\r\n\r\n## Usage Examples\r\n\r\nOnce the system is running, you can ask Neo (the AI agent) questions like:\r\n\r\n- **Customer Analysis**: \"How many customers do we have?\" or \"Show me the top 5 customers by spending\"\r\n- **Product Insights**: \"What are our best-selling products?\" or \"Which products have the highest margins?\"\r\n- **Marketing Campaigns**: \"Create a loyalty campaign for VIP customers\" or \"Send a re-engagement email to inactive customers\"\r\n- **RFM Analysis**: \"Show me the RFM analysis of our customers\" or \"Who are our most valuable customers?\"\r\n\r\n## Configuration\r\n\r\n### Environment Variables\r\n\r\n| Variable | Description | Required |\r\n|----------|-------------|----------|\r\n| `OPENAI_API_KEY` | OpenAI API key for AI agent | Yes |\r\n| `DATABASE_URL` | PostgreSQL connection string | Yes |\r\n| `LANGSMITH_API_KEY` | LangSmith tracking (optional) | No |\r\n| `SLACK_BOT_TOKEN` | Slack integration (optional) | No |\r\n| `SLACK_TEAM_ID` | Slack team ID (optional) | No |\r\n\r\n### MCP Servers\r\n\r\nThe system uses three MCP servers:\r\n- **PostgreSQL**: For database queries and analytics\r\n- **Marketing**: For campaign creation and email automation  \r\n- **Slack**: For team communication and notifications\r\n\r\n## Project Structure\r\n\r\n```\r\ncustomer-intelligence-hub/\r\n├── src/crm_agent/           # Core agent logic\r\n│   ├── agent_graph.py       # LangGraph workflow\r\n│   ├── system_prompts.py    # AI agent prompts\r\n│   └── mcp_servers/         # MCP server configurations\r\n├── cli/                     # Interactive command-line interface\r\n├── database/                # Database setup and sample data\r\n├── docker-compose.yml       # Docker orchestration\r\n└── pyproject.toml          # Python dependencies\r\n```\r\n\r\n## Troubleshooting\r\n\r\n### Common Issues\r\n\r\n**Database Connection Error**\r\n```bash\r\n# Check if PostgreSQL is running\r\ndocker-compose ps\r\n# Restart if needed\r\ndocker-compose restart postgres\r\n```\r\n\r\n**Missing Dependencies**\r\n```bash\r\n# Rebuild containers\r\ndocker-compose down\r\ndocker-compose up --build\r\n```\r\n\r\n**Empty Database**\r\n```bash\r\n# Re-generate and import sample data\r\ndocker-compose exec crm-agent bash -c \"cd database \u0026\u0026 uv run python generate_data_tables.py\"\r\ndocker-compose exec crm-agent bash -c \"cd database \u0026\u0026 uv run python import_data.py\"\r\n```\r\n\r\n### Monitoring\r\n\r\n- **LangSmith Dashboard**: https://smith.langchain.com/ (project: `customer-intelligence-hub`)\r\n- **Database Status**: `docker-compose exec postgres psql -U crm_user -d crm_database -c \"\\dt\"`\r\n- **Container Logs**: `docker-compose logs crm-agent`\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Make your changes\r\n4. Submit a pull request\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielm3%2Fcustomer-intelligence-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielm3%2Fcustomer-intelligence-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielm3%2Fcustomer-intelligence-hub/lists"}