General E-commerce Store Agent
Help shoppers browse products, check stock, place orders, and get post-purchase support — all through WhatsApp, web chat, or Facebook Messenger.
What you'll build
An agent that handles the full shopper journey: browsing products, checking availability, placing orders, and resolving post-purchase questions across WhatsApp, web chat, and Messenger.
Prerequisites
- BimpeAI account with an API key (
sk_…) - Read Anatomy of a workflow agent first — this recipe skips steps covered there
- A product catalogue you can paste as text or expose at a URL
Steps
1. Find the workflow
Search the public library for an e-commerce workflow.
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
const page = await bimpe.workflows.list({ scope: "public", search: "ecommerce" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
page = client.workflows.list(scope="public", search="ecommerce")
workflow = page.data[0]
print(workflow.id, workflow.name)2. Create the agent
const agent = await bimpe.agents.create(
{
name: "Store assistant",
system_prompt:
"You help shoppers browse products, check stock, place orders, and resolve post-purchase questions. Always confirm item availability before confirming an order.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-store-agent-v1" },
);
console.log(agent.id);agent = client.agents.create(
name="Store assistant",
system_prompt=(
"You help shoppers browse products, check stock, place orders, and resolve "
"post-purchase questions. Always confirm item availability before confirming an order."
),
agent_workflow_id=workflow.id,
idempotency_key="create-store-agent-v1",
)
print(agent.id)3. Add knowledge bases
Add your product catalogue. Use a text source for a static list or a url source if you have a live catalogue endpoint.
// Static catalogue
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Product catalogue",
content: `
SKU001 | Blue running shoes | £65 | In stock: 42
SKU002 | White trainers | £55 | In stock: 18
SKU003 | Black yoga mat | £30 | In stock: 5
`,
});
// Or a live endpoint
// await bimpe.agents.knowledgeBases.create(agent.id, {
// type: "url",
// name: "Product catalogue",
// url: "https://yourstore.com/catalogue.json",
// });# Static catalogue
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Product catalogue",
"content": (
"SKU001 | Blue running shoes | £65 | In stock: 42\n"
"SKU002 | White trainers | £55 | In stock: 18\n"
"SKU003 | Black yoga mat | £30 | In stock: 5"
),
})
# Or a live endpoint
# client.agents.knowledge_bases.create(agent.id, {
# "type": "url",
# "name": "Product catalogue",
# "url": "https://yourstore.com/catalogue.json",
# })4. Connect channels and integrations (dashboard)
Channels and integrations are dashboard-only
The API cannot create channel connections or integrations. Connect them in the Console dashboard and use the SDK to list what is active.
- Open Console dashboard → Agents → select your agent.
- Go to Channels → connect your WhatsApp Business number.
- Go to Channels → add the web chat widget and copy the embed snippet.
- Go to Channels → connect your Facebook Messenger page.
- (Optional) Go to Integrations → connect your payment gateway.
5. Go live
Once channels are connected, conversations arrive automatically. Verify what is active:
const channels = await bimpe.agents.channels.list(agent.id);
console.log("Active channels:", channels.map((c) => c.type));channels = client.agents.channels.list(agent.id)
print("Active channels:", [c.type for c in channels])Full example
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "ecommerce" });
const workflow = page.data[0];
// 2. Create agent
const agent = await bimpe.agents.create(
{
name: "Store assistant",
system_prompt:
"You help shoppers browse products, check stock, place orders, and resolve post-purchase questions.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-store-agent-v1" },
);
// 3. Add product catalogue
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Product catalogue",
content: `
SKU001 | Blue running shoes | £65 | In stock: 42
SKU002 | White trainers | £55 | In stock: 18
SKU003 | Black yoga mat | £30 | In stock: 5
`,
});
// 4. Verify connected channels (configured in the dashboard)
const channels = await bimpe.agents.channels.list(agent.id);
console.log("Channels:", channels.map((c) => c.type));
console.log("Agent ready:", agent.id);import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
# 1. Find workflow
page = client.workflows.list(scope="public", search="ecommerce")
workflow = page.data[0]
# 2. Create agent
agent = client.agents.create(
name="Store assistant",
system_prompt=(
"You help shoppers browse products, check stock, place orders, "
"and resolve post-purchase questions."
),
agent_workflow_id=workflow.id,
idempotency_key="create-store-agent-v1",
)
# 3. Add product catalogue
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Product catalogue",
"content": (
"SKU001 | Blue running shoes | £65 | In stock: 42\n"
"SKU002 | White trainers | £55 | In stock: 18\n"
"SKU003 | Black yoga mat | £30 | In stock: 5"
),
})
# 4. Verify connected channels (configured in the dashboard)
channels = client.agents.channels.list(agent.id)
print("Channels:", [c.type for c in channels])
print("Agent ready:", agent.id)Deploy
Store your API key in BIMPEAI_API_KEY and run the setup script once during deployment. The idempotencyKey prevents duplicate agents if the script runs twice. After go-live, list active conversations by channel (whatsapp, webchat, messenger) to monitor volume and feed into your order dashboard.
Variations
- Add a returns policy knowledge base entry so the agent can answer refund questions without escalation.
- Connect a payment gateway in the dashboard Integrations tab to enable in-conversation checkout.
- Scope the agent to a single product category by narrowing the catalogue content and adding a category constraint to
system_prompt.
Fraud Alert Verification Agent
Call customers automatically when a transaction is flagged, walk through a verification flow, and escalate to a human or block the card if verification fails.
Hotel Reservation & Concierge
Let guests check room availability, make reservations, ask about amenities, and get local recommendations — across WhatsApp and web chat.