Commit Graph

20 Commits

Author SHA1 Message Date
tocmo0nlord
667cf87202 Docs: add Call Workflow section (ordered call script)
Document AVA's directed call script — reason first, location, caller info
(address by name), verify phone by readback near the end, wrap up with "anything
else?" — and the gated closing (Goodbye only after the anything-else question).
Note the 8B reliability ceiling on step ordering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 03:44:31 +00:00
tocmo0nlord
9d65fa9aaa Give AVA a clear ordered call workflow
Replace loose "gather these details" with a directed script so the call has
clear direction:
  1. Reason first — what are they calling about
  2. Location — city/area, confirm the matching office
  3. Caller info — full name, then address them by name; insurance (log only),
     preferred day/time
  4. Verify phone near the end by reading it back
  5. Wrap up — recap, then "Is there anything else I can help you with?"

Closing hardened: "Goodbye" (which ends the call) is gated behind the
anything-else question, never said in the same turn as confirming details.
Be warm but direct; one short turn at a time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 03:44:03 +00:00
tocmo0nlord
0605025113 Set AGENT_NAME_SPOKEN=Eva (example) and document name/phone behaviour
- .env.example: add AGENT_NAME_SPOKEN=Eva.
- CLAUDE.md: note the agent-name respelling (AVA -> Eva, "EE-vuh"), that the
  caller-ID is injected pre-spelled (model mangles raw digits), and that the
  phone is confirmed near the END of the call, not led with.

(.env itself is gitignored; AGENT_NAME_SPOKEN=Eva set there and live.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 02:33:08 +00:00
tocmo0nlord
703c902d0f Fix phone readback, lead-with-number flow, and AVA pronunciation
- Phone: inject the caller-ID into the prompt already spelled digit-by-digit so
  the model repeats clean words instead of mangling raw digits (it had emitted
  "197-three five seven three..." -> Kokoro read "one hundred ninety-seven").
- Flow: stop leading with the phone number. Prompt now flows naturally and
  saves the callback-number confirmation for the END; the caller-ID line says
  not to recite it early. Verified 3/3 openings no longer recite the number.
- Name: Kokoro spelled all-caps "AVA" as "A-V-A". Respell to AGENT_NAME_SPOKEN
  (default "Ava") in TTS only; logs/Odoo keep AGENT_NAME. Override e.g.
  AGENT_NAME_SPOKEN=Eva for an "EE-vuh" sound.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 02:08:52 +00:00
tocmo0nlord
24d4efd7ed Docs: office-selection rule (confirm match, don't offer others)
Note in the Call Data Capture table that AVA confirms a matching office and
moves on rather than offering/comparing other offices — the fix for the
"I'm in Kendall" -> "Hollywood or Miami?" off-script behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 01:55:56 +00:00
tocmo0nlord
6010b136a7 Fix office selection: confirm the matching office, don't offer others
When a caller named a city matching an office ("I'm in Kendall"), AVA confirmed
Kendall then asked them to pick between unrelated offices ("Hollywood or
Miami?"), going off script. Tightened the prompt: on a city that matches an
office, confirm THAT office and move on; never offer/compare other offices or
ask the caller to choose; name the nearest only if nothing matches. Verified
3/3 on the failing scenario.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 01:30:35 +00:00
tocmo0nlord
92abe209f3 Fix SpokenKokoroTTSService.run_tts signature (broke all call audio)
run_tts is called as run_tts(self, text, context_id); the override only accepted
(self, text), so every utterance raised "takes 2 positional arguments but 3
were given" and produced no audio — callers heard nothing on every call since
the number-normalization change. Added context_id and pass it through. Verified
the service now emits audio (118KB for a sample) with digits normalized.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 01:13:45 +00:00
tocmo0nlord
46409bd51a Docs: SpokenKokoroTTSService number normalization
Document the TTS number-reading fix in the "already solved" section: phone
numbers, street numbers, and zips are spoken digit-by-digit (no "dash"/parens,
country code dropped); dates/times left natural. tts_normalize() holds the rules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 04:20:43 +00:00
tocmo0nlord
1204d24340 Read phone numbers, street numbers, and zips digit-by-digit in TTS
Kokoro spoke "983-4969" as "nine hundred eighty-three dash forty-nine sixty-
nine". Added SpokenKokoroTTSService which normalizes text just before synthesis
(run_tts gets the full sentence): US phone patterns and 4-5 digit runs (street
numbers, zips) are spoken one digit at a time, country code dropped, no "dash"/
parens. Dates and times are left natural. Deterministic, so it's robust to
whatever the model emits.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 04:17:54 +00:00
tocmo0nlord
b31f685d91 Raise model num_ctx to 8192 to fix mid-call silence
Long calls overflowed the 4096-token window mid-conversation, forcing Ollama to
truncate + re-evaluate the full context each turn = multi-second stalls / dead
air. Rebuilt activeblue-avc:latest with num_ctx 8192 (rollback tag
activeblue-avc:pre-ctx8k). Combined with removing the 45-day calendar injection,
this keeps long calls well under the window. Doc: context row, Modelfile
reference, and a root-cause note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 03:53:41 +00:00
tocmo0nlord
08d9db4f09 Docs: dates are capture-and-defer (in-call computation removed)
Update the call-capture section to reflect the fix — AVA takes the day/time in
the caller's words and defers exact-date confirmation to staff; the 45-day
calendar injection and in-call date validation were removed after a real call
derailed and the 8B model proved unable to compute dates reliably. Post-call
resolved_date is best-effort/staff-verified only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 03:20:57 +00:00
tocmo0nlord
19728e1555 Fix bad-call regressions: drop in-call date computation, tighten replies
A real call derailed: AVA argued about today's date, parroted the canned date
example, hallucinated appointment availability, and rambled. Root cause was the
date-validation feature — the local 8B model computes appointment dates wrong
~5/5 in testing, so having it state/correct dates is a liability.

- DATES: capture & defer — AVA takes the day/time in the caller's own words,
  never computes/states/corrects the calendar date, never argues about today;
  staff confirm the exact date on callback. Removed the 45-day calendar
  injection and _date_context()/datetime use.
- Hardened the no-availability rule (no "openings", no "check availability",
  no "I'll book").
- Brevity: one short sentence per reply (two at most).

Post-call extractor still records a best-effort resolved date (staff-verified).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 03:20:22 +00:00
tocmo0nlord
199d16c630 Document call data capture, date validation, and hang-up grace pause
- New "Call Data Capture & Date Validation" section: the six captured fields
  (full name, phone confirm/alternate, office, reason, insurance log-only,
  validated preferred date/time), how each is logged, and the per-call calendar
  injection that drives date pushback.
- EndCallProcessor note: HANGUP_DELAY_SECS grace pause; Phase 1 gate result.
- .env reference: add HANGUP_DELAY_SECS.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 03:01:49 +00:00
tocmo0nlord
b8c71b15c2 Capture full appointment details + validate dates in-call
In-call (system prompt + per-call calendar injection):
- Gather full name (prompt asks for last name if only first given).
- Confirm the caller-ID number; if declined, use the number the caller gives.
- Ask for and LOG insurance only — never promise/confirm/deny coverage or
  treatment based on it; staff verify on callback.
- Validate the requested date against an injected 45-day calendar (recomputed
  per call since the server is long-running). Push back on impossible/mismatched
  dates, e.g. "Monday lands on the sixth — would you like that date?".
- AGENT_NAME=AVA; 4s grace pause before hang-up (HANGUP_DELAY_SECS).

Logging (post-call extraction -> Odoo):
- Extract full name, phone_confirmed, chosen callback (caller-ID or alternate),
  insurance, reason, and preferred time annotated with a resolved YYYY-MM-DD
  date (today's date is fed to the extractor).
- odoo_client: insurance row on the lead note (log only — staff verify).

.gitignore: ignore rotated avc_run.log* files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 03:00:35 +00:00
tocmo0nlord
93620be9bb Update CLAUDE.md: Phase 1 keeps Whisper STT + Twilio Auth Token
Reframe Change 1/2/3 to record the actual decisions instead of the trialed
swaps: Deepgram and the Twilio Standard API Key were both evaluated and
reverted. Document why the API Key cannot replace the Auth Token (Twilio signs
webhooks with the Auth Token). Update the .env reference, Phase 1 checklist,
dependencies, and open items accordingly; gate zombie-check uses ps/pgrep
(bare process, not Docker).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 01:09:50 +00:00
tocmo0nlord
5ed641255c Revert Phase 1 STT/auth swaps: stay on Whisper + Twilio Auth Token
Deepgram and the Twilio Standard API Key were reverted per decision:
- bot.py: restore HintedWhisperSTTService (faster-whisper hotwords), default
  model medium; remove DeepgramSTTService import + DEEPGRAM_API_KEY.
- server.py: restore TWILIO_AUTH_TOKEN for X-Twilio-Signature validation and
  the serializer auto-hang-up. Twilio signs webhooks with the Auth Token, so
  an API Key Secret cannot validate signatures.
- .env.example: back to TWILIO_AUTH_TOKEN + Whisper STT vars.
- .gitignore: ignore runtime *.log (avc_run.log).

OLLAMA_MODEL stays activeblue-avc:latest (the existing pulled tag).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 01:06:24 +00:00
tocmo0nlord
004ef3bdc0 Update CLAUDE.md: Gitea URLs + keep repo name consistent as avc-phone-ai
Adds the full Gitea repo URL to the infrastructure table and the monitoring
dashboard line, and keeps the repository-structure tree root as avc-phone-ai
to match the rest of the doc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 23:57:57 +00:00
tocmo0nlord
204865b733 Fix repo name references to avc-phone-ai in CLAUDE.md
Header, structure tree, and footer pointed at avc-phone-agent; the actual
Gitea repo is avc-phone-ai. The avc-phone-agent-prod Twilio API key name is
left unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:46:48 +00:00
tocmo0nlord
c3c719b77e Initial commit: avc-phone-ai codebase + CLAUDE.md 2026-06-23 22:38:22 +00:00
4bf72b9616 Upload files to "/" 2026-06-23 20:45:56 +00:00