{"id":51569270,"url":"https://github.com/piyushxbhardwaj/amosflowai","last_synced_at":"2026-07-10T18:01:21.580Z","repository":{"id":369821656,"uuid":"1291729058","full_name":"piyushxbhardwaj/AmosFlowAI","owner":"piyushxbhardwaj","description":"AI-powered GTM automation system using LangGraph, FastAPI, and Streamlit for company enrichment, personalized outreach, CRM tracking, and follow-up automation.","archived":false,"fork":false,"pushed_at":"2026-07-07T05:46:37.000Z","size":2117,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-07T06:13:45.447Z","etag":null,"topics":["ai","automation","crm","fastapi","langgraph","llm","python","streamlit"],"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/piyushxbhardwaj.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":"2026-07-07T03:52:10.000Z","updated_at":"2026-07-07T04:41:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/piyushxbhardwaj/AmosFlowAI","commit_stats":null,"previous_names":["piyushxbhardwaj/amosflowai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/piyushxbhardwaj/AmosFlowAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyushxbhardwaj%2FAmosFlowAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyushxbhardwaj%2FAmosFlowAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyushxbhardwaj%2FAmosFlowAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyushxbhardwaj%2FAmosFlowAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piyushxbhardwaj","download_url":"https://codeload.github.com/piyushxbhardwaj/AmosFlowAI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyushxbhardwaj%2FAmosFlowAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35338653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"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":["ai","automation","crm","fastapi","langgraph","llm","python","streamlit"],"created_at":"2026-07-10T18:01:13.980Z","updated_at":"2026-07-10T18:01:21.569Z","avatar_url":"https://github.com/piyushxbhardwaj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AmosFlow AI\n## An Autonomous GTM Pipeline for AI-Powered Company Research, Personalized Outreach, and Follow-Up Automation\n\nAmosFlow AI is a lightweight GTM (Go-To-Market) automation system that automates company enrichment, decision-maker discovery, personalized cold outreach, CRM updates, and follow-up generation from a simple CSV input. \n\nThis repository implements the complete end-to-end workflow using **LangGraph** for AI reasoning agent state orchestration, **FastAPI** for core REST API routes, and **Streamlit** for a visual sales pipeline dashboard.\n\n---\n\n## Architecture Diagram\n\nThe system is designed with a strict separation of concerns, separating the AI reasoning graph from operational service interfaces:\n\n```text\n                  CSV Companies\n                        │\n                        ▼\n              FastAPI REST API\n                        │\n                        ▼\n             LangGraph Workflow\n ┌──────────────────────────────────────┐\n │ Company Enrichment                   │\n │ Analyze Company                      │\n │ Contact Discovery                    │\n │ Personalized Outreach                │\n │ Follow-up Generation                 │\n └──────────────────────────────────────┘\n                        │\n                        ▼\n              Service Layer\n      Gmail │ Sheets │ SQLite │ Scheduler\n                        │\n                        ▼\n              Streamlit Dashboard\n```\n\n---\n\n## Features\n- **Idempotent Leads Loader**: Reads seed targets from `companies.csv` and skips or updates existing entries using domain checking to prevent duplication.\n- **AI-Powered Company Analysis**: Queries enrichment APIs (Tavily/Firecrawl fallbacks) and scrapes website content using BeautifulSoup, then feeds findings into a Gemini or OpenAI LLM to parse GTM insights (ICPs, hiring, funding, product offerings).\n- **Contact Discovery**: Queries Apollo APIs to find relevant executive contacts (CEO, Founder, Growth Leads), falling back to a structured and clearly labeled simulated placeholder (`demo-contact@example.com (Simulated Contact)`) if credentials are absent.\n- **Explainable Lead Scoring**: Programmatically computes a GTM fit score (0.0 to 1.0) based on weighted parameters (ICP fit, funding signals, hiring status, news, AI adoption indicators) and saves a confidence metric.\n- **Hyper-Personalized Copywriting**: Generates friendly, human-sounding outreach emails (\u003c 120 words) referencing target products and news while strictly omitting generic praise or boilerplate merge words.\n- **Email Dispatch \u0026 Queueing**: Saves emails to a SQLite dispatch queue. If Gmail OAuth credentials are configured, it automatically drafts them in the user's Gmail box.\n- **Syncable CRM Database**: Tracks company profiles, contacts, lead score, current pipeline stages, reply state, and activities in SQLite, auto-syncing to Google Sheets.\n- **Reply monitoring \u0026 Automation**: Implements a background APScheduler that polls for replies. If a prospect replies (simulated via API or UI), outreach stops. If there is no response, the system automatically drafts a shorter polite follow-up.\n\n---\n\n## Workflow Nodes\n1. `load_csv`: Reads targets and imports them as `Imported` leads.\n2. `enrich_company`: Scrapes target homepages and crawls news signals.\n3. `analyze_company`: Extracts GTM insights returning a structured JSON schema.\n4. `find_contact`: Discovers a decision-maker email and social profiles.\n5. `personalize_email`: Drafts a tailored cold outreach email (\u003c 120 words) with subject and copy.\n6. `draft_email`: Places email in SQLite queue and syncs to Gmail drafts.\n7. `update_crm`: Updates lead score and sets pipeline stage to `Emailed`.\n8. `check_reply`: Periodically checks reply state.\n9. `generate_followup`: Crafts a polite, shorter follow-up email if no reply is detected after 3 days.\n10. `queue_followup`: Queues the follow-up draft.\n11. `update_crm_followup`: Updates CRM stage to `Follow-up Sent`.\n\n---\n\n## Technology Stack\n- **Backend Framework**: Python 3.12, FastAPI, Uvicorn\n- **Agent Orchestration**: LangGraph, LangChain Core\n- **LLM Connectivity**: LangChain Google GenAI (Gemini 1.5 Flash / Gemini Pro) or LangChain OpenAI (GPT-4o / GPT-4o-mini)\n- **Database**: SQLite3 (built-in)\n- **Dashboard**: Streamlit\n- **Enrichment \u0026 Scraping**: BeautifulSoup4, Requests, Tavily API (optional)\n- **Scheduler**: APScheduler\n- **Google Integrations**: Google API Client, Google Auth (for Sheets and Gmail, optional)\n\n---\n\n## Installation\n\n### 1. Clone the repository\nNavigate into the workspace folder `d:/Project/AmosFlow AI/`.\n\n### 2. Install Dependencies\nMake sure you have python 3.12 installed. Run the command to install packages:\n```bash\npip install -r requirements.txt\n```\n\n### 3. Environment Variables Setup\nCopy `.env.example` to a new file named `.env` and set your API keys:\n```text\nOPENAI_API_KEY=your-openai-api-key\nGOOGLE_API_KEY=your-gemini-api-key\nTAVILY_API_KEY=your-tavily-search-key\nAPOLLO_API_KEY=your-apollo-person-search-key\nGOOGLE_SHEETS_CREDENTIALS=path/to/sheets-credentials.json\nGOOGLE_SHEETS_SPREADSHEET_ID=your-google-spreadsheet-id\n```\n*Note: If no API keys are provided, the system gracefully falls back to mock engines, BeautifulSoup scraping, and demo placeholder profiles, making it 100% runnable out of the box.*\n\n---\n\n## Execution Guide\n\nTo run the full pipeline locally:\n\n### 1. Launch FastAPI Backend\nStart the backend server on `http://127.0.0.1:8000`:\n```bash\nuvicorn backend.main:app --reload --port 8000\n```\n\n### 2. Launch Streamlit Dashboard\nIn another terminal window, run the dashboard:\n```bash\nstreamlit run streamlit/app.py\n```\nOpen `http://localhost:8501` in your browser.\n\n---\n\n## Simulated Demonstration Scenario\n1. Navigate to the **Control Panel \u0026 Actions** tab on Streamlit.\n2. Click **Trigger GTM Outreach Pipeline**. This reads the seed companies from `data/companies.csv`, processes them through LangGraph agents, updates SQLite, and creates outreach drafts.\n3. Refresh data or click tabs (**CRM Pipeline**, **Enriched Companies**, **Target Contacts**, **Outreach Logs**) to see live outputs.\n4. Select a company and click **Trigger Simulated Reply** on the control panel. Refreshing will show that lead as `Replied`, stopping the follow-up flow.\n5. For other emailed leads, click **Execute Follow-up Scheduler Now** to simulate time passing. The system will detect no reply and automatically queue a polite, short follow-up draft.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyushxbhardwaj%2Famosflowai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiyushxbhardwaj%2Famosflowai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyushxbhardwaj%2Famosflowai/lists"}