Skip to content

Build EricBot — AI Clone & Business Development Engine - #7

Draft
hatcheric950 wants to merge 7 commits into
mainfrom
claude/dazzling-hopper-jJe87
Draft

Build EricBot — AI Clone & Business Development Engine#7
hatcheric950 wants to merge 7 commits into
mainfrom
claude/dazzling-hopper-jJe87

Conversation

@hatcheric950

@hatcheric950 hatcheric950 commented May 27, 2026

Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • Full EricBot implementation: FastAPI backend + React dashboard + CLI tools
  • Voice learning system that extracts your communication patterns from real samples and feeds them into every Claude prompt
  • Lead pipeline across all 4 ventures with AI-generated outreach drafts that sound like you
  • Accountability tracker with Claude-generated nudges and automated scheduling
  • NEW: SMS auto-responder (Twilio) with contact tiering and safety guardrails

SMS Auto-Responder

Routes every inbound text by who sent it:

Tier Behavior
business Drafts in your voice. Routine messages can auto-send (per-contact opt-in + global master switch); price/scheduling/commitments queue for one-tap approval.
personal Never answered in your voice. Optional honest away-reply + a high-priority reminder so you respond.
unknown Logged + flagged, no auto-reply.

Safety model — all automatic sending is off by default behind the SMS_AUTO_SEND_ENABLED master switch plus per-contact opt-in. Message classification fails closed to manual review. Personal relationships are never ghostwritten — that design choice is intentional and documented in the README.

New backend: services/sms.py (Twilio + webhook signature verification), services/auto_responder.py (routing brain), services/style_context.py, routers/sms.py. New ai_engine functions: classify_sms, draft_sms_reply, generate_away_reply. New Inbox tab in the dashboard (approval queue + contact tiering + safety banner).

Test plan

  • python smoke_test_sms.py — verifies routing + personal-contact safety guarantees (all checks pass)
  • cp .env.example .env, add ANTHROPIC_API_KEY (+ Twilio creds for SMS)
  • pip install -r requirements.txt && python -m backend.server
  • GET /api/health returns {"status": "ok"}
  • Point Twilio Messaging webhook at /api/sms/webhook, add contacts, set tiers
  • Flip SMS_AUTO_SEND_ENABLED=true only when ready
  • docker-compose up -d for production

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
EOF
)

claude added 7 commits May 27, 2026 20:47
Full implementation of the EricBot system:
- FastAPI backend with SQLite persistence
- Claude-powered AI engine using Eric's voice profile
- Voice learning system that extracts style patterns from real samples
- Lead pipeline management across all 4 ventures (Hatch, Eric.Digital, Ancient Coast, NEXUS)
- Accountability tracker with AI nudges
- AI-powered outreach drafting that sounds like Eric
- APScheduler for daily nudges (7AM) and follow-up checks (every 2hrs)
- React dashboard (ericbot.jsx) with Chat, Leads, Tasks, Voice, Draft tabs
- CLI voice trainer script (scripts/train_voice.py)
- Docker Compose for production deployment

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
Wires up Twilio SMS (Phase 2) with a tiered routing model that decides how
each inbound text is handled based on who sent it:

- business: drafts in Eric's voice; routine messages can auto-send (opt-in +
  global switch), everything touching price/scheduling/commitments queues for
  one-tap approval
- personal: NEVER answered in Eric's voice — optional honest away-reply plus a
  high-priority reminder so Eric replies himself
- unknown: logged + flagged, no auto-reply

Backend:
- contacts, sms_messages, pending_replies tables
- services/sms.py (Twilio send + webhook signature verification, degrades
  gracefully without creds)
- services/auto_responder.py (tier routing brain)
- services/style_context.py (shared voice-profile loader)
- ai_engine: classify_sms, draft_sms_reply, generate_away_reply (honest, never
  impersonates a live conversation)
- routers/sms.py: webhook, contacts CRUD, approval queue, message log, status

Frontend: new Inbox tab — approval queue, contact tiering, safety banner.

Safety: all auto-send is off by default behind SMS_AUTO_SEND_ENABLED master
switch + per-contact opt-in; classification fails closed to manual review.

smoke_test_sms.py verifies the routing and the personal-contact guarantees.

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
Everyone now gets a draft in Eric's voice and at minimum lands in the
approval queue. The 'protected' boolean is the single, narrow exception
for contacts where in-voice impersonation is off-limits (e.g. spouse).

- protected=true: honest away-reply (if away_mode) + reminder to Eric only
- everyone else: draft in voice → auto-send if routine business + opted-in,
  otherwise approval queue

Adds protected field to contacts table, ContactCreate/Update models,
router, and Inbox tab UI (🔒 Protected toggle per contact, banner update).
Updates smoke_test_sms.py to cover the new routing model (18 checks pass).

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
- Daily nudge now texts Eric at ERIC_PHONE_NUMBER when configured
- sms.py: support API Key SID+Secret auth (preferred) alongside Auth Token
- is_configured() accepts either auth method

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
… tab

- zoom_phone.py: Server-to-Server OAuth, webhook HMAC-SHA256 verification,
  URL validation challenge/response, voicemail transcript fetch via API
- call_responder.py: mirrors auto_responder routing — protected contacts
  get a task reminder only; everyone else gets an AI-drafted follow-up SMS
  queued for one-tap approval (nothing auto-sent for calls)
- routers/calls.py: POST /api/calls/webhook (Zoom events), GET /api/calls/logs,
  GET /api/calls/voicemails, POST voicemails/{id}/approve|reject, GET /api/calls/status
- database.py: call_logs + voicemails tables (IF NOT EXISTS, safe on existing DBs)
- ai_engine.py: classify_voicemail() and draft_call_followup_sms() added
- models.py: VoicemailApproval pydantic model
- server.py: register calls router
- ericbot.jsx: Calls tab — status banner, voicemail/follow-up queue with
  editable drafts + approve/dismiss, recent call log table

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
ai_engine.py auto-detects xai- prefix: routes client to api.x.ai and
defaults model to grok-4. sk-ant- keys continue using claude-sonnet-4-6.
CLAUDE_MODEL env var overrides either default.

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
- docker-compose.yml: use env_file:.env so all credentials pass through;
  bind port to 127.0.0.1 only (nginx terminates TLS externally)
- nginx/ericbot.conf: HTTPS reverse-proxy template with Let's Encrypt hooks;
  replace YOUR_DOMAIN to activate
- deploy.sh: one-command bootstrap — installs Docker, clones repo, starts
  compose, configures nginx, runs certbot; prints webhook URLs at the end

https://claude.ai/code/session_017AD8eyJ5iZmVXwiwoCQ6aY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants