Overview
Sharathi answers the messages that land on a business’s Facebook Page, at any hour, without a person watching the inbox. A customer writes in, the agent reads the last few turns of the conversation, replies from the business’s own pricing and product details, and the whole exchange appears on a live dashboard as it happens.
Most small teams cannot staff an inbox around the clock. A message at 2 AM waits until morning, and by then the buyer has often gone elsewhere. Sharathi closes that gap. It replies the moment a message comes in, and it keeps a human in view through a dashboard that streams every conversation and lets the team tune the agent’s tone and knowledge without touching code.
We built Sharathi as a small, honest full-stack system. An Express and Socket.IO backend receives Facebook’s webhooks, generates replies with OpenAI gpt-4o, and pushes each message to a React dashboard over WebSockets. State stays light on purpose. Conversation history lives in memory, and connected Pages persist to a flat file rather than a database, so the whole thing is cheap to run and quick to deploy.
We have open-sourced it. A team can clone the repository on GitHub, add their own API key, and deploy it on their own infrastructure in minutes.
The reply is sent back to the customer on Facebook, and every message streams to the dashboard over Socket.IO.
The Problem
A Facebook inbox does not keep office hours, but the people answering it do. That mismatch creates real cost:
- Messages arrive overnight and on weekends, long after the team has logged off
- Buyers expect an answer in minutes and leave when they do not get one
- Repetitive questions about price, sizing, stock, and delivery fill the queue
- Hiring people to cover every shift is expensive and hard to sustain
A generic autoresponder does not solve this. It cannot answer a real question, so it only tells the customer to wait. What a business needs is an agent that understands the message, replies with the correct details, and knows when to hand the conversation to a person instead of guessing.
What Sharathi Does
Sharathi connects to a Facebook Page once and takes over the replies from there. It does not sleep, take weekends, or go offline, so a message at 2 AM is answered as quickly as one at 2 PM.
The agent replies the moment a message comes in, using the business’s actual pricing and product details rather than invented ones. Every conversation streams to one live dashboard in real time, where the team can read what the agent is saying and edit its tone or knowledge themselves. Because the reply is grounded in real information, a question the agent should not answer alone can be left for a person instead of receiving a guessed answer.
It fits both solo founders and support teams. Founders use it to stay reachable without hiring for it. Support teams use it to handle the messages their staff cannot get to.
Business Challenges
- Inboxes Never Close – Customers message a Page at every hour. A team answering by hand cannot cover nights, weekends, and holidays without either burning out or hiring around the clock.
- Slow Replies Lose Buyers – A question left for hours often becomes a lost sale. Buyers move to whoever answers first, so response speed is a revenue problem, not only a support one.
- Answers Have to Match Reality – An agent that guesses at pricing or stock does damage. Every reply must come from the business's real product and pricing details, not from invention.
- A Wrong Answer Costs Trust – One confident but incorrect reply can end a customer relationship. The system needs a way to defer to a human rather than fabricate an answer it does not hold.
- Small Teams, No Ops Budget – Founders and lean support teams cannot run a heavy platform. The tool has to deploy quickly, stay cheap to host, and need almost no maintenance.
- Owning the Conversations – Businesses want their inbox agent on their own infrastructure and keys. A closed hosted product means handing every customer conversation to a third party.
Technical Challenges
Answering a live social inbox reliably means solving several engineering problems at once.
- Meta Webhooks and the Send API – Facebook delivers messages through webhooks that must verify a handshake, respond fast, and reply through the Send API with the correct Page token.
- OAuth Page Connection – Connecting a Page needs a full OAuth 2.0 flow, token exchange, webhook subscription, and safe storage of each Page access token on the server.
- Conversation Memory Without a Database – The agent needs recent context per user. We kept a rolling window of the last ten messages in memory, so the stack stays light and easy to run.
- Live Updates to the Dashboard – Every inbound and outbound message has to appear on the dashboard the instant it happens, which we handle with a single Socket.IO event stream.
- Tuning Behavior Without a Redeploy – Teams need to change the agent's tone and knowledge themselves. The dashboard edits the system prompt directly rather than shipping new code each time.
- One Command to Deploy – A small team should launch in minutes. A single script provisions the server, reverse proxy, and process manager, then redeploys on every run.
- Several Pages, One Instance – A business may run more than one Page. The backend connects and manages each Page dynamically, with the tokens persisted per Page to disk.
What We Built
An Express and Socket.IO Backend
The backend is a single Express app that does four jobs. It serves the REST API the dashboard talks to, receives Meta’s webhook calls, generates AI replies, and pushes every message through Socket.IO so the dashboard updates live. When a message arrives, the webhook responds to Meta right away, hands the text to the AI agent, streams the exchange to the dashboard, and sends the reply back through the Send API.
AI Replies With Memory
The AI agent calls OpenAI gpt-4owith a rolling window of the last ten messages for each user, kept in memory. That gives the agent enough context to hold a coherent conversation without a database behind it. The agent’s behaviour comes from a system prompt that the team can rewrite from the dashboard, so tone and product knowledge change without a code change.
Facebook Messenger Integration
Connecting a Page runs a full OAuth 2.0 flow that exchanges the login code, stores the Page tokens, and subscribes the webhook. From there the backend verifies Meta’s webhook handshake, receives live incoming events, and replies through the Facebook Send API. Several Pages can be connected and managed at once, with tokens persisted per Page, plus a static token as a single-page fallback.
The Live Dashboard
The dashboard is a React app with three panels. One connects and monitors Facebook Pages, one simulates an incoming message so the agent can be tested without a real Page, and one edits the agent’s system prompt. Every inbound and outbound message streams into the interface in real time over Socket.IO.
Core Capabilities
- Live dashboard that streams every message in real time
- Facebook Messenger connection through Meta OAuth and webhooks
- AI replies grounded in your own pricing and product details
- Rolling per-user memory of recent conversation turns
- Live prompt editor to tune the agent's tone and knowledge
- Webhook simulator for testing without a live Page
- Support for several connected Pages from one instance
- One-command deployment to a cloud virtual machine
- Open source, so it runs on your own infrastructure and keys
One-Command Deployment
A single deploy script sets up a Google Cloud virtual machine on first run, reserving a static IP and provisioning the instance with Node, Nginx, and PM2. On every run after that it ships the latest code, installs dependencies, and restarts the process, with Nginx reverse-proxying traffic to the app.
Technology Stack
- Frontend: React 18, Vite 5, Tailwind CSS 3, Socket.IO client
- Backend: Node.js, Express 5, Socket.IO, Axios, dotenv
- AI: OpenAI gpt-4o with a rolling per-user memory window
- Messaging: Meta Graph API for Facebook Messenger — OAuth, webhooks, Send API
- Storage: In-memory conversation history, flat JSON file for Page tokens
- Deployment: Google Cloud Compute Engine, Nginx, PM2
Results & Validation
Sharathi is deliberately small. It does one job well, answers a social inbox at any hour from real product data, and stays cheap and simple enough for a lean team to run on its own keys.
Because the code is open, a business is not tied to a hosted product or a monthly seat. It downloads the agent, drops in its own API key, and runs the whole thing in its own environment, with every conversation staying on its own infrastructure.
Key Takeaways
- Speed is the feature. For a social inbox, the win is answering in seconds at any hour, not crafting the cleverest reply.
- Grounding beats improvisation. An agent tied to real pricing and product data is far more useful than one free to guess.
- Keep the stack light. In-memory history and a flat token file removed the need for a database and kept the whole system easy to run.
- Keep a human in view. A live dashboard and an editable prompt let a person watch, tune, and step in when the agent should not answer alone.
- Ship it open. Open sourcing the agent lets any team run it on their own keys and infrastructure, with nothing locked away.
- Own the messaging layer. Handling OAuth, webhooks, and the Send API directly gave full control over how and when replies are sent.