A small Chainlit-based data analyst chat agent that answers questions about a synthetic business dataset, runs pandas / matplotlib code when needed, and returns outputs (stream) and inline PNG plots.
- Released in March 2023 (alpha for ChatGPT Plus).
- Integrated with Assistant API.
- Assistant API will be deprecated in 2026
⚠️ ; use Responses API instead. - Responses API creates an isolated container to execute Python code, with outputs such as images stored within the container.
- Open-source alternatives (e.g., Open Interpreter) are not actively developed; using Responses API is recommended. Integration with Chainlit has issues:
- Open Interpreter (v0.4.3) sometimes fails to install with Chainlit (v2.7.2) due to dependency collisions.
- Code Interpreter API (v0.1.20) has issues with Azure OpenAI.
-
synthetic_business_data.csv
- Synthetic, tabular business / transaction data for demo and analysis.
-
synthetic_metadata.json
- JSON object describing columns and their human-readable descriptions.
- Create a
.envwith required Azure variables:AZURE_OPENAI_ENDPOINTAZURE_OPENAI_DEPLOYMENT_NAMEAZURE_OPENAI_API_KEYAZURE_OPENAI_API_VERSION
- Install dependencies:
poetry install
- Run the app:
python app.py
- In the chat, ask questions about the dataset. The assistant will run code for calculations/plots and return results.
- Tool execution writes a Python script, runs it, and returns stdout/stderr plus any generated PNGs inline.
- File uploads are disabled in the chat flow.
app.legacy.pyis present in the repo but is considered legacy / not used by the code.- If you plan to deploy or extend for Azure, follow Azure best practices, secure
.envsecrets 🔐, and review deployment guidance.
