Quick Start with Chat Table
Build Intelligent Conversational Applications in Minutes with JamAI Base Chat Tables
1. Introduction
This guide will help you quickly get started with JamAI Base chat tables using the Python SDK. You'll learn how to create a simple chat application similar to the example provided.
2. Prerequisites
Python 3.11 or above
JamAI Base account
Personal Access Token (PAT)
Project ID
3. Installation
pip install jamaibase4. Basic Setup
Get your Personal Access Token (PAT) here:
Get your Project ID here:

5. Creating a Chat Agent (UI First)
Go to JamAI Base web interface chat table tab

Navigate to "Agents" section, click + to create new agent.

Name the new agent "example_agent"and select LLM model.

You can further configure your agent in UI but it will not be covered in this tutorial.
Example of some configuration you can do:
Set system prompt
Set multiple parallel agent
Configure RAG settings
Set up knowledge base
6. Creating Chat Sessions
Each chat session is created by duplicating your base agent table. Here's how to do it:
7. Basic Chat Interaction
8. Simple Implementation Example
9. Key Features
Streaming Responses: Use
stream=Truefor real-time responsesSession Management: Each chat creates a new table instance
Inheritance: New chats inherit settings from the base agent
History Preservation: Chat history is maintained in the table
10. Best Practices
Create a new chat session for each conversation
Handle exceptions during table creation
Store chat IDs for session management
Clean up unused chat tables periodically
11. Complete Runnable Example
Here's a complete, standalone example that you can copy, paste, and run:
How to Run:
Save the code in a file (e.g.,
chat_demo.py)Install required packages:
Replace the following values:
your_project_idwith your actual Project IDyour_pat_tokenwith your Personal Access Tokenexample_agentwith your agent ID created in the UI
Run the application:
This example provides:
A simple chat interface
Streaming responses
New chat session creation
Basic error handling
Note: Make sure you have created your agent in the JamAI Base UI before running this code, as it relies on duplicating an existing agent table.
This example serves as a great starting point for building more complex chat applications with JamAI Base.
Last updated
Was this helpful?