AgentSquared

Inspiration

We wanted to build a realistic place where an AI agent could do something useful: answer real customer questions in a real-looking environment. Support forums are full of repeat questions (shipping, returns, policies, promos). We imagined an AI that reads a company knowledge base and replies as a consistent, on-brand assistant — so we built a demo e‑commerce site with a community forum and a clear role for that agent.

What it does

AgentSquared is a demo platform where an AI agent acts as a forum assistant. The site includes a storefront (products, policies, FAQ) and a Community Forum where customers ask questions. No answers are pre-written. The AI agent (Aria) logs in as the “AI Assistant,” reads the company knowledge base (a single markdown file), and posts or edits answers. Everyone sees the same forum: questions and answers are stored and synced for all users, including when the site is shared via ngrok or localtunnel. The agent isn’t talking to a static page — it’s interacting with a live, shared Q&A that persists across sessions and devices.

How we built it

  • Frontend: React 18, Vite, Tailwind CSS, React Router. Dark theme, responsive layout, and pages for Home, Products, Product Detail, Shipping, Returns, FAQ, About, and the Forum.
  • Forum API: We serve the forum from the same Vite dev server via a small plugin (vite-forum-api.js) so there’s only one process to run. It handles GET /api/threads, POST /api/threads (new question), and POST /api/threads/:id/answer (post or update answer). Data is stored in data/forum.json.
  • Knowledge base: A single markdown file in public/ holds the company’s policies, products, contact info, and FAQs. The AI agent fetches it (same origin) and uses it as the only source of truth for answers.
  • Tunneling: We support sharing the app with ngrok (npm run tunnel) and, for networks where ngrok hits SSL issues, localtunnel (npm run tunnel:lt) so the forum works the same for everyone on the same public URL.

Challenges we ran into

  • Ngrok SSL errors: On some Wi‑Fi networks (e.g. school or restricted networks), both Chrome and Safari failed with ERR_SSL_PROTOCOL_ERROR or “can’t establish a secure connection” to the ngrok URL. We figured out it was the network blocking or inspecting traffic to ngrok; the same setup worked on a phone hotspot. We added localtunnel as a fallback so the project is still shareable when ngrok doesn’t work.
  • Keeping forum and app in sync: We initially had a separate Express server for the forum API. Forgetting to run it caused “answers disappearing after refresh” and different data on different devices. We moved the API into the Vite dev server so one command (npm run dev) runs both the site and the forum backend, and everyone using the same URL sees the same data.
  • Designing for an agent: We had to make the forum easy for an AI to use: clear login (Aria credentials), a single knowledge doc, and predictable API so the agent can list threads, read questions, and POST answers without scraping the DOM.

Accomplishments that we're proud of

  • Single-command run: One npm run dev gives you the full site plus forum API and persistence; no separate backend to remember.
  • Real agent workflow: The forum has no canned answers. The agent must read the knowledge base and write replies — a realistic testbed for “AI as support agent.”
  • Shareable demo: With ngrok or localtunnel, we can give judges or teammates one link; they see the same forum and can ask questions that the agent can answer live.
  • Clean, focused UI: Dark theme, clear forum layout, and obvious “Ask a Question” and “Post answer” flows so both humans and agent flows are easy to follow.

What we learned

  • Tunneling services (ngrok vs localtunnel) behave differently across networks; having a fallback is important for demos.
  • Embedding a small API in the dev server simplified our setup and made “run the app” and “run the forum” the same step.
  • Designing for an AI user (clear APIs, one knowledge source, predictable DOM) improved the experience for human testers too.

What's next for AgentSquared

  • Multi-tenant / multi-store: One AgentSquared backend that can plug into multiple storefronts with different knowledge bases and branding.
  • Agent memory and context: Let the agent see prior answers and thread history so it can reference earlier replies and avoid contradicting itself.
  • Moderation and safety: Let the agent flag or escalate off-topic or abusive posts and suggest replies for a human to approve before posting.
  • Analytics and improvement: Log which answers get upvotes or “was this helpful?” so we can tune the knowledge base and prompts.

Built With

Share this project:

Updates