Commit History
-
Fix chat agent web search, greeting resume, and lead capture gaps
Seth +1: Claude Sonnet 5Competitor comparison tables defaulted straight to "Requires confirmation" because the agentic prompt never told the model to actually use its search_the_web tool for the comparison — only that the tool existed. Now the model is instructed to search before falling back, and to label web-sourced cells as unverified public info rather than a settled claim. The widget's opening greeting silently disappeared on any repeat open within the same browser (existing localStorage session skipped the greeting fetch entirely, with no history shown either). Added a session- resume endpoint so reopening replays prior messages, or shows the greeting if nothing was exchanged yet. Chat-agent-sourced leads were linked into Contacts the same way as Smartlead reply-imports, which the enrichment "Fetch" gate explicitly excludes — and no extraction logic existed at all for company name, only visitor name. Chat-agent leads now get form-style (enrichable) contacts, and company name is extracted from the conv…b5da8dd
-
Chat Agent: proactive website CTAs and per-conversation token usage tracking
Seth +1: Claude Sonnet 5- 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>9889053
-
Chat Agent: render markdown tables properly, show web-search usage to admins, fix pricing leak
Seth +1: Claude Sonnet 5- 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…f6dedbf -
Chat Agent: opt-in live web search (Gemini) with skill-editable guardrails + AI disclaimer
Seth +1: Claude Sonnet 5Generalizes 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>9d44313 -
Chat Agent Skills: real YAML, templates/, virtual file browser, sandboxed script execution
Seth +1: Claude Sonnet 5Four 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 …14acdb1 -
Chat Agent: full Agent Skills library (SKILL.md anatomy)
Seth +1: Claude Sonnet 5Rebuilds 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>0bbe01f
-
Chat Agent: stop hallucination/repetition/markdown bugs, auto-show greeting
Seth +1: Claude Sonnet 5Three concrete bugs found from a real transcript ("DMS vs Laserfiche" question): 1. Hallucination: the model said "I couldn't find that in the knowledge base, however based on general knowledge..." and then invented specific competitor pricing. Closed the loophole explicitly in both the agentic (OpenAI) and classic (Gemini) system prompts: an "I don't know" answer must be the model's entire response, with no fabricated continuation -- it has no reliable general knowledge about this company's pricing, specs, or competitors. Also nudged it to try more than one search angle (own product + competitor name) before giving up on a comparison question, rather than quitting after one narrow miss. 2. Repetition: the lead-capture "ask once, early" instruction relied on the model remembering not to repeat itself, and it didn't. Now enforced in code via already_asked_for_contact -- once any prior assistant turn exists in history, the instruction is dropped from th…f928cd6 -
Chat Agent: genuinely agentic RAG for OpenAI (tool-calling loop, not single-shot)
Seth +1: Claude Sonnet 5Replaces the old "always pre-retrieve top-6 chunks, then answer once" flow (for the default OpenAI provider) with a real agentic loop: the model gets a search_knowledge_base tool and decides per-turn whether to search at all, can chain a second refined search for hard multi-part questions, and can hint which source (Drive vs. website) is more likely to have the answer (now a real source_filter on retrieval, not cosmetic). Kept fast on purpose: runs with stream=True through the whole loop, so a question that needs no search streams live starting on the very first call (no added latency vs. the old design); tool-call rounds are silent internally (local, in-process retrieval, no network) and only the round that actually produces the answer is forwarded to the client. Bounded to MAX_SEARCH_ROUNDS=2 (3 LLM calls worst case) so latency stays predictable -- verified the cap is real by confirming `tools` is absent from the API call on the forced final round, not just coincidentally unused. S…eeb98fa
-
Chat Agent: sitemap-based crawl discovery + source citation links
Seth +1: Claude Sonnet 5Website crawler now seeds from sitemap.xml (incl. WordPress-style nested sitemap indexes) instead of relying solely on nav-link BFS, raises the page cap 150->400, retries transient 403/429/5xx with backoff, switches to a standard browser User-Agent (a self-identifying bot UA was tripping generic WAF bot-blocklists on real WordPress sites), and skips pages that look like a bot-challenge/captcha interstitial rather than indexing them as content. Chat replies now cite the specific website pages they drew on as a "Sources:" line with markdown links (deduped, website-only, max 3), and the embed widget renders those as real clickable links via a small safe markdown-lite renderer (DOM text nodes only, http(s)-only hrefs) instead of plain text. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>4b33072 -
Add Chat Agent module: RAG website widget with Drive/site knowledge base and CRM lead capture
Seth +1: Claude Sonnet 5Adds 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>991c079