Autonomous AI Sales Agent — Knowledge Base & Dynamic Bundling
Single source of truth for every live service & package on Nbyula. Edits here propagate to every tab in this document, are persisted locally, and can be exported as a JSON config that the AI sales agent consumes at runtime. The goal: zero hallucination, accurate pricing, and a deterministic bundling engine that closes deals without human intervention.
What's in this document
- 1Services tab — every á la carte service Nbyula sells, with the exact deliverables, prerequisites, turnaround time and price the AI agent must quote. Inline editable.
- 2Packages tab — Pro / Premium / Ultimate. Full feature matrix. The AI uses this to identify when a cart should be upsold to a plan.
- 3Cart Logic Rules — every cross-sell, upsell, bundle & discount rule with a written rationale (the why) so the founder & the agent both know the reasoning.
- 4Live Cart Simulator — add services to a fake cart, see exactly which rules fire and what the AI would pitch next.
- 5AI Agent Grounding — auto-generated system prompt + retrieval JSON the AI agent loads from this config.
- 6Architecture & Deploy — step-by-step GitHub + Cloudflare Pages setup (same pattern as Ops Graph).
Why "synced edits"
A common failure mode of AI sales agents is stale knowledge — the model quotes a price that hasn't been valid for 2 months. We solve this in two layers:
- Single in-page state store: every tab reads from
window.state. Edit a service price in tab 2 → it instantly reflects in tab 3's rules, tab 4's simulator, and tab 5's AI prompt. - localStorage persistence: edits survive page refresh.
- JSON export → GitHub → Cloudflare: a single commit redeploys the source of truth the AI fetches at runtime.
Pitch — for the founder
AI agent hallucinates prices, forgets deliverables of niche services, can't logically bundle, and never knows when to escalate to a package. Coaches re-pitch the same SOP+LOR+Filing trio on every call.
A deterministic, editable knowledge base (50 services, 3 packages) wired to a rules engine (15+ cross-sell, upsell, and package-threshold rules). The agent calls this — never guesses.
AOV ↑ via consistent cross-sell of SOP+LOR after every Application Filing. Package conversion ↑ via threshold-triggered Pro/Premium pitches. Hallucination → ~0 via grounded retrieval.
Subscription Plans (Pro · Premium · Ultimate)
These plans are the "package upsell ceiling" the agent pushes toward when a cart approaches a plan's price.
Dynamic Cart Generation — Rules Engine
The agent does not freestyle bundles. It runs every cart through 4 rule families, in order. The rationale column tells the founder why each rule exists — most map directly to known student behavior patterns from past calls.
① Cross-sell Rules
② Upsell Rules
③ Package Upsell Thresholds
④ Negotiation & Discount Rules
Live Cart Simulator
Add services to a mock cart. The right panel shows exactly which cross-sell / upsell / package / discount rules fire — this is what the AI agent will pitch.
Add to cart
🤖 What the AI agent would pitch next
AI Agent Grounding
Auto-generated from the knowledge base above. Paste this into the AI agent's system prompt or load the JSON at runtime. Regenerates every time you edit a service or rule.
System Prompt (paste into Vapi/Bland/your agent platform)
Retrieval JSON (the agent fetches this at session start)
System Architecture
Same deployment pattern as the Ops Graph artifact: static HTML in GitHub → auto-deployed via Cloudflare Pages → fetched by the AI agent and rendered by ops at kb.nbyula.com.
locally or via Web UI] -->|Export JSON / commit| B[📦 GitHub Repo
nbyula-sales-kb] B -->|webhook| C[☁️ Cloudflare Pages
kb.nbyula.com] C -->|HTTPS GET /config.json| D[🤖 AI Sales Agent
Vapi / Bland / Custom] C -->|HTTPS GET /| E[👥 Sales Team
browses live KB] D -->|on cart change| F[Cart Logic Engine
fires rules] F -->|push| G[💳 Nbyula Cart API
nbyula.com/api/cart] G --> H[Lead checkout] style A fill:#F3EEFF,stroke:#5F2EEA style D fill:#CCFBF1,stroke:#14B8A6 style F fill:#FEF3C7,stroke:#F59E0B
Step-by-step deployment (GitHub + Cloudflare Pages)
-
1
Create the GitHub repo
Repo name:
nbyula-sales-kb(private). Add this HTML asindex.htmlat root. Also commit an emptyconfig.json— this will be the retrieval JSON the AI agent fetches.gh repo create nbyula/nbyula-sales-kb --private --add-readme git clone git@github.com:nbyula/nbyula-sales-kb.git cd nbyula-sales-kb # drop this HTML in as index.html git add . && git commit -m "initial KB v1" && git push
-
2
Connect to Cloudflare Pages
In the Cloudflare dashboard → Workers & Pages → Create → Pages → "Connect to Git". Pick the repo. Build settings:
- Framework preset: None (static HTML)
- Build command: leave empty
- Build output directory:
/
Hit Deploy. Cloudflare gives you a
*.pages.devURL within ~30 seconds. -
3
Map the custom domain
Pages project → Custom domains → Add →
kb.nbyula.com. Cloudflare auto-creates the CNAME. SSL auto-issued in ~1 minute. -
4
Wire the AI agent to fetch
/config.jsonIn the AI agent platform (Vapi / Bland / our own), add a tool / function call at session start:
async function loadKB() { const r = await fetch('https://kb.nbyula.com/config.json', { headers: { 'Cache-Control': 'no-cache' } }); return await r.json(); } // inject the result into the system prompt as <services> and <rules> blocks
Use the AI Agent Grounding tab to copy the exact JSON / prompt template.
-
5
The daily edit loop
- Open
https://kb.nbyula.com - Edit a service price / add a rule (everything is inline-editable)
- Click Export JSON → save as
config.json - Commit + push to GitHub (or use the GitHub web UI to replace the file)
- Cloudflare auto-deploys in 30 sec → next AI call picks up the new prices
Optional follow-up: add a Cloudflare Worker that lets ops PATCH
/config.jsondirectly from the page — eliminates the git commit step entirely. - Open
-
6
Resource ask (per sprint plan)
One dedicated engineer to handle the AI agent's runtime fetch + the Cloudflare Worker for in-place edits. Estimated effort: 3–5 engineering days total once this HTML is in place.
Why GitHub + Cloudflare (and not a database)
Every price change = a git commit. Founder asks "when did the SOP price change to ₹2,499?" → blame the line.
Static HTML on Cloudflare Pages is free + globally cached. No DB, no API, no on-call.
Bad rule? git revert → Cloudflare redeploys. The AI is back to the previous knowledge in < 1 min.