Chat Agent: proactive website CTAs and per-conversation token usage tracking
Seth+1: Claude Sonnet 5
9889053
- Strengthen the Website Link Promotion skill section (and the code-level
CITATIONS instructions that produce the actual link) so the agent actively
surfaces a relevant indexed page as a call-to-action whenever one exists,
instead of only citing it as a passive afterthought.
- Track total LLM tokens spent on each reply (summed across every round of
the agentic tool-calling loop, or from Gemini's usage metadata on that
provider) and surface it in the admin Conversations tab: per message, per
conversation, and as an overall total across every chat for the tenant.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Chat Agent: render markdown tables properly, show web-search usage to admins, fix pricing leak
Seth+1: Claude Sonnet 5
f6dedbf
- Render GFM pipe tables as real <table> markup (with horizontal scroll) in the
Test Chat panel, Conversations transcript, and the embeddable widget, instead
of dumping raw "| a | b |" text into a narrow chat bubble.
- Track whether a reply actually used the search_the_web tool and surface a
"Used live web search" badge to admins (Test Chat + Conversations), so a
live-web-sourced answer is never mistaken for a knowledge-base answer.
- Fix a real pricing leak: a visitor comparison question ("are you cheaper than
X") caused the agent to recite actual EZOFIS pricing pulled from the tenant's
own indexed content, because the comparison-table instruction pushed the
model to fill every cell from retrieval, overriding the separate "never
disclose pricing" rule. Added a hard, code-level backstop that strips
dollar-amount/discount patterns out of retrieved chunk text before it ever
reaches a prompt, plus reinforced the comparison-table instruction itself.
- Make the Gemini fa…
Chat Agent: opt-in live web search (Gemini) with skill-editable guardrails + AI disclaimer
Seth+1: Claude Sonnet 5
9d44313
Generalizes the agent's web-lookup tool from competitor-only research into a
general search_the_web tool the agentic loop can reach for whenever the
knowledge base isn't enough, gated behind enable_web_search + a configured
Gemini key. Hard safety boundaries (never our own pricing/confidential info,
always framed as unverified) stay in code; "when it's worth searching"
guidance is now editable via the default skill's instructions. Also adds a
persistent "AI can make mistakes" disclaimer to both the embeddable widget
and the admin Test Chat panel.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Chat Agent: comprehensive EZOFIS default skill, ZIP export, Gemini fast indexing
Seth+1: Claude Sonnet 5
b5da702
- Replace the 3 small guardrail skills with one comprehensive default skill
authored from EZOFIS's real website-agent governance document: condensed
non-negotiable rules always injected via instructions, 10 topic references
searched on demand (keeps every live turn fast), 6 canned-response
templates, a real runnable compliance-checker script, and 8 eval cases
lifted from the document's own test scenarios. A migration auto-
consolidates any tenant whose skills are exactly the old 3 unmodified
defaults; tenants with custom skills are left untouched.
- Fix a real bug found while stress-testing the larger content: the eval
parser's regex was missing re.MULTILINE, so only the first eval of any
multi-eval skill ever parsed back on import.
- Elaborate each Skills section (References/Assets/Templates/Scripts/Evals)
in the Cards UI with its purpose and a worked example.
- Add a ZIP export (GET /api/chat-agent/skills/export-zip + Download ZIP
button) producing the exact ski…
Four upgrades to the Skills anatomy, aimed at making this a faithful demo of
Anthropic's Agent Skills format:
- Real YAML frontmatter (pyyaml) instead of a hand-rolled regex parser, which
broke on descriptions containing a colon/quote/comma — now round-trips
correctly via safe_dump/safe_load.
- New templates/ folder, a full sibling to assets/ throughout: schema,
migration, SKILL.md compile/parse, knowledge-base indexing/search, CRUD
routes, and a frontend section.
- A virtual file-browser view (Cards / File browser toggle in the Skills tab)
that renders the DB-backed skill anatomy as a real-looking
skills/<name>/{SKILL.md,references/,assets/,templates/,scripts/,evals/}
tree with a live preview pane, since there's no actual filesystem to browse
on this hosting.
- Admin-only sandboxed script execution: a real "Run" button that executes
Python in an isolated subprocess (secrets stripped from its environment,
timeout-bound, output capped). This is never reachable from …
Chat Agent: full Agent Skills library (SKILL.md anatomy)
Seth+1: Claude Sonnet 5
0bbe01f
Rebuilds the flat guardrail-string Skills feature into Anthropic's real
Agent Skills format: name + description + instructions (always injected
into the prompt), plus references/assets (indexed into the same
knowledge base the agentic search tool already searches), scripts
(stored/exported for documentation only — never executed, see
SKILLS-SECURITY.md), and evals (test cases graded by substring match or
an LLM judge). Skills export/import as real, portable SKILL.md files.
Also fixes a resilience gap found while testing live in the browser: an
indexing failure (e.g. the embeddings API being down) was crashing the
whole skill save with a 500 and losing the admin's text edits. The
skill's own fields now commit first, indexing runs in its own
try/except, and a failed index attempt rolls back cleanly so the next
save retries instead of getting stuck thinking it's already indexed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Chat Agent panel fires config/skills/status/conversations in parallel
on first load (separate fetches in ChatAgentPanel.jsx). Each independently
calls get_or_create_config, which did a plain SELECT-then-INSERT with no
protection against concurrent callers: two requests could both see "no row
yet" and race to insert, and the loser crashed with a raw
sqlite3.IntegrityError (UNIQUE constraint failed: chat_agent_configs.
tenant_id) surfaced as a 500 -- exactly what showed up in the HF logs on a
fresh config (first load after a restart/tenant creation).
get_or_create_config now wraps the insert in a SAVEPOINT (db.begin_nested())
and falls back to re-reading the row on IntegrityError, so a lost race
returns the winner's row instead of crashing -- and since the loser no
longer calls ensure_default_skills again, the 3 default skills aren't
duplicated either.
Verified by reproducing the exact scenario: 4 real threads calling
get_or_create_config concurrently for a brand-new tenant now pro…
Add Chat Agent module: RAG website widget with Drive/site knowledge base and CRM lead capture
Seth+1: Claude Sonnet 5
991c079
Adds an embeddable WordPress chat widget backed by a Google Drive folder and a
site crawl, with admin-editable skills/guardrails, streaming replies, and
automatic CrmLead creation (with live transcript) for every chat that shares
a name/email.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>