A Python library powered by Language Models (LLMs) for conversational data discovery and analysis.
A Python library powered by Language Models (LLMs) for conversational data discovery and analysis.
Hosted version: bambooai.org — the same analyst, nothing to install.
BambooAI is an LLM-driven data analyst that works in a persistent Python kernel, one cell at a time, and reproduces its own results before it reports them. You give it a dataset and a question; it writes and runs code, reads the output, decides the next step, and ends with a report whose cited numbers have been re-executed in a fresh kernel. It runs on your machine with your own model keys, and the code the model writes runs in a container, not under your account.
BambooAI is built for people who analyse data for a living and want the work done the way they would do it: in a notebook, step by step, with every intermediate result visible and every final number checked. It is not a chat interface over a code interpreter. The analyst has a fixed set of actions, a one-page contract that is the same for every model, a budget it can see, and a report format it must fill in. The web app streams the run as it happens, keeps the notebook, and lets you ask follow-up questions against the same kernel state.
It came out of sports science — training and physiology data from Intervals.icu, Endura and SweatStack load directly — and applies to any tabular dataset.
A run is a sequence of turns. In each turn the analyst reads what it has so far — the question, the dataset's description, the cells and their (truncated) outputs, the budget — and takes one action:
| action | effect |
|---|---|
CELL |
run one Python cell in the kernel; the printed output is the next turn's input |
SHOW n |
re-open the full output of an earlier cell |
NAMES |
list the variables the kernel holds |
RECALL |
consult the memory pack for this dataset |
SEARCH |
web search with Google AI grounding, summarised and cited |
ASK |
put one question to the person and wait for the answer |
REPORT |
write the report; the run ends |
The contract that governs this is one page, analyst/contract.md, and is the same for every model.
It asks for a report with a best estimate and its uncertainty, the conditions it holds under,
how it was established, and the cells and figures it rests on; usually one to three figures, drawn
with Plotly.
After REPORT:
Rewriter seat writes the plain-language version.Modes and budgets. Each mode sets a turn budget and a dollar budget the analyst can see. The
budgets are per preset (tier_properties in the configuration). At the performance preset: Quick 4
turns, Deep 15, Adaptive 50 with a self-review every 8 turns. In Adaptive mode the review turns run
on the Reviewer seat — a stronger model — which reads the run so far and can redirect it.
Memory. When you save a run, the Knowledge Distiller seat writes a card about the dataset —
what the columns mean in practice, what to watch for, what worked — into
memory//memory_pack.yaml. RECALL reads it in later runs.
Requirements: Python 3.11 or newer, and Docker (Docker Desktop on macOS and Windows, Docker Engine on Linux), running. Docker is where the model-written code runs; see Where the Code Runs for the alternative.
Option 1 — pip (recommended)
pip install bambooai
bambooai serveOption 2 — from the repository
git clone https://github.com/pgalko/BambooAI.git && cd BambooAI
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
bambooai serveOption 3 — hosted. bambooai.org runs the same analyst as a service, with nothing to install.
bambooai serve. On first use it creates the working folder ~/bambooai, writes a .env there,
builds the executor image from the Dockerfile in the package (several minutes, once: the image
installs pandas, numpy, scipy, statsmodels, scikit-learn, matplotlib, plotly and the rest), starts
the container, and opens http://127.0.0.1:5001.~/bambooai/.env. An OpenRouter key is
enough on its own: every model in the default configuration is reachable through OpenRouter. Add
GEMINI_API_KEY if you want web search.bambooai serve again. Upload a CSV, Parquet, JSON or XLSX file and ask a question. Choose
Quick, Deep or Adaptive in the composer.cost, performance or max —
and saves it. Usage shows the calls, tokens and cost per run.The working folder:
…serve reads nothing outside this folder. Upgrading the package does not change it; deleting it
starts you fresh. BAMBOO_HOME or bambooai serve --home DIR moves it.
All in ~/bambooai/.env. Lines starting with # are ignored; do not put comments after a value.
| variable | meaning |
|---|---|
OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, XAI_API_KEY, MISTRAL_API_KEY, DEEPSEEK_API_KEY |
provider keys; only for the providers the seats use |
GEMINI_API_KEY |
also enables web search (Google AI grounding); without it SEARCH is off |
REMOTE_OLLAMA, REMOTE_VLLM |
base URLs of local model servers, e.g. http://localhost:11434 |
BAMBOO_LEVEL |
cost / performance / max: the preset before one is saved in the app |
BAMBOO_COMPUTE |
docker (default) or local |
EXECUTOR_PORT |
the container's published port (default 5055) |
EXECUTION_MODE, EXECUTOR_API_BASE_URL |
to use an executor you run yourself: api and its URL. BAMBOO_COMPUTE is then ignored |
BAMBOO_USER |
the identity that names the per-user folders (default local) |
SWEATSTACK_CLIENT_ID, SWEATSTACK_CLIENT_SECRET |
your own SweatStack app registration; without them the SweatStack integration is not offered |
APP_PORT |
the web app's port (default 5001) |
SESSION_COOKIE_NAME, FLASK_SECRET, LLM_CONFIG_ENCRYPTION_KEY |
the server; the last two are generated on first use |
LLM_CONFIG_template.json in the working folder defines the seats for each of four presets
(free_agent_configs, cost_agent_configs, performance_agent_configs, max_agent_configs), the
turn budgets per preset (tier_properties), and the properties of every model named
(model_properties). The performance preset as shipped:
…The seats:
| seat | role |
|---|---|
Analyst |
runs the analysis: every turn, every cell, the report |
Reviewer |
the self-review turns in Adaptive mode; a stronger model |
Rewriter |
the plain-language version of the report |
Knowledge Distiller |
writes the memory card when a run is saved |
Google Search Executor |
the grounded search itself (a Gemini model) |
Google Search Summarizer |
condenses search results into a cited digest |
Image Generator |
turns the report into an infographic (a YAML spec rendered to SVG) shown with the answer |
Seat fields: model, provider, reasoning_effort (none, low, medium, high, xhigh;
mapped to each provider's own vocabulary, or to a thinking budget for models that use one),
max_tokens, temperature. Every model a seat names must appear in model_properties, which
supplies its prices per 1K tokens (used for the running cost), its formatting (xml or text) and
its reasoning interface.
A seat on a local server:
{"agent": "Analyst", "details": {"model": "qwen3:32b", "provider": "ollama", "reasoning_effort": "medium", "max_tokens": 16000, "temperature": 0}}with REMOTE_OLLAMA=http://localhost:11434 in .env and a model_properties entry with zero prices.
With every seat on Ollama or vLLM and no Gemini key, no request leaves the machine.
The app builds config//LLM_CONFIG.json from the template for the chosen preset, and rebuilds
it when the template file is newer than the built one.
df. The Data tab pages
it.SWEATSTACK_CLIENT_ID,
SWEATSTACK_CLIENT_SECRET).GEMINI_API_KEY.The analysis kernel, the reproduction run and the integrations' data fetching all run in the executor container: a Flask API in front of the persistent kernel, from `containers/e
No open issues yet, or sync has not completed.