SALES AGENT

YOUR INBOX.
YOUR AI SALES AGENT.

An AI employee for a Facebook Messenger shop inbox. It answers from your real product catalog, sends product photos, and creates orders. You stay focused on running the business.

  1. Customer: do you have the blue one in medium?
  2. Sales agent checks the real product catalog.
  3. Catalog: Classic Shirt, Blue, Medium, ৳1,450, in stock.
  4. Agent replies with the product and a photo.
  5. Order created: Classic Shirt, quantity 1, total ৳1,450.

THE PROJECT

AN AI EMPLOYEE FOR YOUR MESSENGER INBOX.

Sales Agent connects a Facebook Page inbox to a product catalog, AI, and order system. Customers can ask about products, receive real product information and images, and place orders directly through the conversation.

Built as an open-source system with multiple AI providers, product-aware tools, customer memory, human handoff, and a dashboard for managing the whole operation.

  1. CUSTOMER

    “red shoe price?”

  2. AI SALES AGENT

  3. PRODUCT CATALOG

    RED SHOE · ৳1,200 · IN STOCK

  4. MESSENGER

    [ PRODUCT IMAGE ]

    “Yes, ৳1,200. Available.”

  5. ORDER

    ✓ CREATED

ROLE
BUILT FROM SCRATCH
STACK
NEXT.JS · RUST / WASM · CLOUDFLARE · TURSO · AI
LICENSE
MIT
STATUS
OPEN SOURCE

EXPLORE THE PROJECT

THE SYSTEM

SEE IT IN ACTION.

Full Sales Agent walkthrough: dashboard, inbox, catalog, orders, AI settings, and setup

01OVERVIEW

WATCH THE FULL RUN.

ONE RECORDING

One take, nothing cut in the middle. dashboard, inbox, catalog, orders, AI settings, setup, in that order.

02DASHBOARD

START WITH THE OVERVIEW.

SEE WHAT MATTERS

The needs-attention list, today's numbers, and provider health. Read-only triage. It refreshes itself.

STAY IN CONTROL

Inbox, catalog, orders. One sidebar, no page-hopping.

03INBOX

EVERY CONVERSATION IN ONE PLACE.

READ THE THREAD

The full back-and-forth, customer and agent, in the order it happened.

STEP IN WHEN NEEDED

Take over with human handoff. The AI goes quiet on that thread until you hand it back. Drafts, notes, pin, resolve included.

04CATALOG

YOUR SHELF, ON SCREEN.

EDIT WHAT YOU SELL

Name, price, stock, description per product. custom columns and images on top, CSV import for bulk. No code.

THE AGENT READS HERE FIRST

Every price and availability answer comes from this table. Only enabled catalogs count. If it is not on the shelf, it does not get sold.

05ORDERS

WHEN SOMEONE SAYS YES.

ORDERS WRITE THEMSELVES

A confirmed chat becomes an order. Items, live totals, delivery.

TRACK WHAT IS NEXT

Status runs active to closed, customer details beside it. No payments inside. Fulfillment happens outside the app.

06AI ENGINE

CHANGE THE BRAIN.

PICK YOUR PROVIDER

Start with OpenRouter or OpenAI. Eleven provider types total, priority order, automatic failover. Keys stay encrypted.

GIVE IT MEMORY

Recent customer history plus per-customer summaries. product tools allowlisted per agent, so answers stay grounded.

07AGENTS

WHO SELLS WHAT.

BIND THE PIECES

One agent ties Page, prompt, skills, provider pool, and catalogs together.

DEFAULT ANSWERS

Bind at least one agent, or the default agent answers everything.

03 / SETUP

RUN YOUR OWN SALES AGENT.

  1. 01

    BRING THE TOOLS

    Rust to WebAssembly, the Worker bundler, Node.js 20+, and the Turso CLI for the local database.

    bash
    rustup target add wasm32-unknown-unknown
    cargo install worker-build

    Confirm: rustc --version, node --version, worker-build --version, and turso --version all print.

  2. 02

    COPY THE ENV FILES

    Real secrets live in gitignored files. Never commit them.

    bash
    cp backend/.env.example backend/.dev.vars
    cp frontend/.env.example frontend/.env

    Confirm: Both new files exist.

  3. 03

    MINT THE SECRETS

    Generate three values, then map them: first to API_HANDSHAKE_TOKEN and NEXT_PUBLIC_HANDSHAKE (must match exactly), second to AI_ENCRYPTION_KEY, third to META_ENCRYPTION_KEY.

    bash
    openssl rand -hex 32

    Confirm: No placeholder remains in the top half of backend/.dev.vars. Dev shortcut: HANDSHAKE_DISABLED=1 skips the handshake. Dev only, never in prod.

  4. 04

    START THE DATABASE

    Turso holds every table. Apply the schema files in order against a local dev database.

    bash
    turso dev -f /tmp/turso-dev.db -p 8080 &
    turso db execute http://127.0.0.1:8080 --file backend/migrations/turso/0001_schema.sql
    turso db execute http://127.0.0.1:8080 --file backend/migrations/turso/0002_rate_limit_counters.sql

    Confirm: turso db execute http://127.0.0.1:8080 "select count(*) from sqlite_master;" returns.

  5. 05

    RUN THE BACKEND

    Rust to WASM first. Slow the first time, about a minute after. If worker-build hangs after printing Done, kill it. Artifacts are already written.

    bash
    cd backend
    worker-build --release
    npx wrangler dev --port 3000

    Confirm: curl http://localhost:3000/health prints "ok".

  6. 06

    RUN THE FRONTEND

    Then create the admin password on the setup screen. No seed password exists. First creator wins.

    bash
    cd frontend
    npm install
    npm run dev

    Confirm: The login page loads at http://localhost:3001/login and you land on the dashboard.

  7. 07

    SMOKE TEST THE AI

    Add a provider on the Providers page first. Until then, health plus login is enough.

    bash
    curl -X POST http://localhost:3000/debug/ai/test -H 'Content-Type: application/json' -H "X-Handshake-Token: $API_HANDSHAKE_TOKEN" -d '{"endpoint":"<name>","message":"Hi"}'

WANT A CUSTOM VERSION?

LET'S BUILD IT FOR YOUR SHOP.

Sales Agent is open source and ready to run. If your shop needs something more specific: your catalog, your language, your workflow. I can build a custom sales system around it.