Starting from scratch when building an AI-powered chatbot can be time-consuming. Xano's free Agent Conversation History snippet gives you a plug-and-play foundation — complete with authenticated users, persistent conversation threads, and media support — so you can focus on extending functionality rather than building boilerplate.
To get started, head to the snippet link and click Add to My Xano Account. After signing in, select the instance and workspace where you want it installed. Once added, you'll notice several new tables marked with a yellow icon: agent_user, conversation, and message. These are imported automatically and form the backbone of your chatbot's data structure.
The agent_user table handles authentication by default. If your workspace already has a user table set up, you can swap it in — more on that below.
Navigate to the AI tab, select Agents, and open the settings for the imported Google agent. You'll see it references an environment variable called Gemini_key for its API key. Copy that variable name, go to your workspace Settings, click Manage, and add a new environment variable with your actual Gemini API key. Save it, and your agent is connected.
Inside the API section, find the Chatbot group that came with the snippet. Copy the group's base URL, then open the Get Chatbot endpoint. Paste the base URL into the designated field and save. This endpoint returns a fully rendered web page — HTML, CSS, and JavaScript — via Xano's template engine. Click Publish, copy the endpoint URL, and paste it into a new browser tab to see your chatbot live.
Once you sign in through the chatbot UI using your agent_user credentials, you can start sending messages immediately. The UI includes a toggle that lets you either start a new conversation or return to a previous one. Each conversation is stored separately in the conversation table, and individual messages — including their role (user or assistant) and content type (text or image) — live in the message table.
This means conversation history is truly persistent. You can send images too: use the file upload button in the UI, and the agent will analyze and respond to what you've sent.
The snippet is just a starting point. You can add tools to your agent so it can interact with external services or your own Xano data, giving your users a much richer experience.
If you want to use your existing user table instead of agent_user, go into the endpoint settings for the login and me endpoints and update the authentication table reference. Those are the only two spots that need changing.
With just a few configuration steps, you have a fully functional, authenticated AI chatbot with persistent history ready to build on top of.
Join 100,000+ people already building with Xano.
Start today and scale to millions.