Alex Sales Assistant - Full Scaffold
By Sean WeldonAtlas Development Log — Alex Sales Assistant Scaffold
Overview
Reviewed an architecture plan for "Alex" - an AI sales co-pilot - and provided architectural suggestions before scaffolding the complete implementation. Created a production-ready structure with CRM abstraction, multi-tool orchestration, voice-matched email drafting, and both Slack bot and webhook entry points.
1. Objectives
- Analyze the sales assistant architecture plan and identify improvements
- Scaffold the complete project structure with all core components
- Implement CRM abstraction layer for multiple providers
- Create comprehensive configuration and template systems
Success looks like: A runnable sales assistant scaffold that can be tested in CLI mode and deployed to Slack, with clear extension points for CRM integrations and customization.
2. Key Developments
Technical Progress:
- Created complete agent architecture with Alex (interface), Orchestrator (coordination), and Memory (persistence)
- Built 5 tool modules: Analyzer, Strategist, Drafter, Scheduler, Researcher
- Implemented abstract CRM interface with HubSpot and Mock adapters
- Created Slack bot entry point with Socket Mode support
- Built FastAPI webhook receiver for CRM event handling
System / Agent Improvements:
- Added orchestration layer for multi-tool command chaining (e.g.,
prep= research → analyze → strategize) - Implemented lazy initialization pattern for expensive resources
- Created conversation memory with per-channel/thread context persistence
- Built voice matching system with style rules and example email training
Integrations Added:
- Slack Bolt framework for bot interface
- HubSpot CRM adapter (API v3)
- Apollo.io and Clearbit enrichment API support (optional)
- Google/Outlook Calendar integration stubs
3. Design Decisions
Orchestration Layer
- Decision: Added dedicated Orchestrator class between Alex and tools
- Rationale: Complex commands need tool chaining; keeps Alex focused on interface
- Alternative considered: Direct tool calls from Alex
- Trade-off: Additional abstraction layer, but cleaner separation of concerns
CRM Abstraction
- Decision: Abstract CRMAdapter base class with factory pattern
- Rationale: Support multiple CRMs (HubSpot, Pipedrive) without code changes
- Alternative considered: Direct HubSpot integration
- Trade-off: More initial code, but future-proof for CRM switching
Voice Matching Structure
- Decision: Separate persona.md, style_rules.yaml, and sent_emails/ directory
- Rationale: Different types of voice data need different formats
- Alternative considered: Single YAML file with everything
- Trade-off: More files to manage, but clearer organization
Mock CRM for Development
- Decision: Include MockCRMAdapter with sample data
- Rationale: Enable testing without real CRM connection
- Alternative considered: Require CRM setup for any testing
- Trade-off: Mock data may not reflect real edge cases
4. Challenges & Solutions
LinkedIn Data Access
- Problem: Original plan included LinkedIn integration which has severe API restrictions
- Root cause: LinkedIn's API is heavily gated for data access
- Solution: Recommended Apollo.io/Clearbit as alternatives; added manual URL paste option
Configuration Consistency
- Problem: Need consistent config loading across multiple tools
- Root cause: Each tool would otherwise implement its own config loading
- Solution: Centralized Settings singleton with lazy loading in config.py
5. Code Changes
| File | Change |
|---|---|
agency/agents/sales-assistant/agent/__init__.py |
Package exports |
agency/agents/sales-assistant/agent/alex.py |
Main Slack interface with command parsing |
agency/agents/sales-assistant/agent/orchestrator.py |
Multi-tool workflow coordination |
agency/agents/sales-assistant/agent/memory.py |
Conversation context persistence |
agency/agents/sales-assistant/agent/config.py |
YAML config loader with lazy init |
agency/agents/sales-assistant/agent/prompts.py |
LLM system prompts for each capability |
agency/agents/sales-assistant/tools/__init__.py |
Tool exports |
agency/agents/sales-assistant/tools/analyzer.py |
Lead scoring and briefing generation |
agency/agents/sales-assistant/tools/strategist.py |
Deal analysis and recommendations |
agency/agents/sales-assistant/tools/drafter.py |
Voice-matched email generation |
agency/agents/sales-assistant/tools/scheduler.py |
Calendar integration and time finding |
agency/agents/sales-assistant/tools/researcher.py |
Company/contact enrichment |
agency/agents/sales-assistant/tools/crm/base.py |
Abstract CRM interface |
agency/agents/sales-assistant/tools/crm/hubspot.py |
HubSpot API v3 adapter |
agency/agents/sales-assistant/tools/crm/mock.py |
Development mock with sample data |
agency/agents/sales-assistant/config/pipeline.yaml |
LLM and pipeline settings |
agency/agents/sales-assistant/config/scoring.yaml |
Lead scoring criteria and weights |
agency/agents/sales-assistant/config/strategies.yaml |
Sales playbook and objection handling |
agency/agents/sales-assistant/config/calendar.yaml |
Scheduling preferences |
agency/agents/sales-assistant/templates/your_voice/* |
Voice matching configuration |
agency/agents/sales-assistant/templates/email_templates/* |
5 email template types |
agency/agents/sales-assistant/main.py |
Slack bot + CLI entry point |
agency/agents/sales-assistant/webhooks.py |
FastAPI webhook receiver |
agency/agents/sales-assistant/requirements.txt |
Python dependencies |
agency/agents/sales-assistant/README.md |
Documentation |
agency/agents/sales-assistant/.env.example |
Environment template |
agency/agents/sales-assistant/.gitignore |
Git ignores |
6. Next Steps
- Create Slack app at api.slack.com and obtain tokens
- Add 5-10 real sent emails to
templates/your_voice/sent_emails/for voice training - Test in CLI mode:
python main.py --cli --dry-run - Configure real CRM (HubSpot) and test lead brief generation
- Deploy webhook server and configure CRM webhook subscriptions
- Customize
strategies.yamlwith actual objection handling scripts
7. Session Notes
The scaffold follows patterns from youtube_scout (YAML config, pipeline stages, Anthropic LLM) while adding new patterns appropriate for an interactive agent:
- Lazy initialization prevents loading expensive resources until needed
- Memory persistence enables context across Slack threads
- Dry-run mode allows safe testing without external side effects
- CLI mode enables rapid iteration without Slack setup
Build order recommendation: Drafter (highest immediate value) → Strategist → Researcher → Analyzer → Scheduler (save calendar APIs for last, they're fiddly).