This project is a prototype AI Agent Stack for detecting business activity signals on SMB websites. It focuses on three high‑value triggers:
- Expansion → “Grand Opening”, “New Location”
- Hiring → careers/job postings
- Scheduler → Calendly / Acuity / “Book Appointment”
Each signal collected by the Scraper Agent is wrapped into an Evidence Card evaluated by the validator agent , then passed to an Outbound Agent that drafts a personalized email.(only if the score passes above the fixed threshold value)
Goal. Help sales and marketing teams discover timely triggers that indicate a business is actively growing and worth contacting now. Please refer flow.md for codeflow and schemas.
- Multi‑agent pipeline with LangGraph orchestration
- Modular design with Pydantic schemas
- Local inference with Ollama
- Scoring heuristics
- Regex‑based intent detection
- Confidence weighting with freshness decay
- Automatic email draft generation tied to detected signals
- Configurable via YAML (
configs/config.yml)
- Agents: LangGraph (StateGraph orchestration)
- LLM Runtime: Ollama (local models like
phi3.5,llama3.1) #This prototype uses llama3.1 1B param model pulled using ollama. - Schemas: Pydantic
- Scraping: Requests + BeautifulSoup4 (via
tools/) - Validation: Regex patterns + freshness‑decay scoring
git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Download Ollama
- Pull a model (e.g., llama3.2:1b) you can plug and play with the models.
ollama pull llama3.2:1bEnsure server is running locally at http://localhost:11434.
Update configs/config.yml as needed:
gate:
min_confidence: 0.6
confidence:
weekly_decay: 0.85
floor: 0.3
llm:
validator:
model_id: llama3.2:1b
backend: ollama
max_new_tokens: 200
temperature: 0.05
outbound:
model_id: llama3.2:1b
backend: ollama
max_new_tokens: 300
temperature: 0.25python -m src.app --csv data/test_sites.csv --vertical #vertical_name --out data/results.jsonl (or results.json)Create a test HTML page with signals:
Example:
<h1>Grand Opening! Now Open our new clinic in Cary</h1>
<p>Book an appointment today!</p>
<p>We are hiring staff for our new team.</p>Serve it locally:
python -m http.server 8000Add to data/test_sites.csv:
domain,company
localhost:8000,Test Business
Run the pipeline again—expect a populated Evidence Card and email draft.
{
"domain": "localhost:8000",
"company": "Test Business",
"card": {
"signal_type": "expansion",
"canonical_url": "http://localhost:8000/",
"snippet": "Grand Opening! Now Open our new clinic in Dallas",
"confidence": 0.72,
"explain": "explicit_phrase; freshness=0.92"
},
"email": {
"subject": "Congrats on your new Dallas clinic",
"body": "Hi Test Business — noticed your Dallas opening.\n\nMany teams use AI-assisted workflows to route leads in real time and convert faster.\n\nWould a 10-minute walkthrough next week be useful?",
"call_to_action": "Open to a quick walkthrough?"
}
}- LangGraph coordinates a StateGraph of tools/agents that:
- Fetch and parse site content,
- Detect signals via regex/semantic cues,
- Score with freshness decay,
- Assemble Evidence Cards,
- Draft outbound emails conditioned on the detected signal(s).
- Pydantic enforces strict schemas for Evidence Cards and email payloads.
- Ollama enables local inference for validator and outbound generation, minimizing cost and maximizing privacy.
- (ongoing) Create a Natural language understanding interface that maps user prompts to pre-defined ICPs across common verticals.
- Semantic scoring with FAISS + reranker (still rethinking on how to go about it)
- CRM/marketing integrations for automated workflows.
.
├── configs/
│ └── config.yml
├── data/
│ ├── test_sites.csv
│ └── results.jsonl
├── index.html
├── requirements.txt
├── src/
│ ├── app.py
│ ├── agents/
│ ├── tools/
│ └── schemas/
└── README.Rmd
python -m src.app \\
--csv data/test_sites.csv \\
--vertical #vertical \\
--out data/results.jsonl

