databao-agent 0.1.4.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- databao_agent-0.1.4.dev4/.gitignore +26 -0
- databao_agent-0.1.4.dev4/LICENSE.md +80 -0
- databao_agent-0.1.4.dev4/PKG-INFO +310 -0
- databao_agent-0.1.4.dev4/README.md +266 -0
- databao_agent-0.1.4.dev4/client/out/multimodal-html/index.html +261 -0
- databao_agent-0.1.4.dev4/client/out/multimodal-jupyter/index.js +47925 -0
- databao_agent-0.1.4.dev4/client/out/multimodal-jupyter/style.css +1 -0
- databao_agent-0.1.4.dev4/databao/__init__.py +39 -0
- databao_agent-0.1.4.dev4/databao/api.py +93 -0
- databao_agent-0.1.4.dev4/databao/caches/__init__.py +0 -0
- databao_agent-0.1.4.dev4/databao/caches/disk_cache.py +54 -0
- databao_agent-0.1.4.dev4/databao/caches/in_mem_cache.py +27 -0
- databao_agent-0.1.4.dev4/databao/configs/__init__.py +3 -0
- databao_agent-0.1.4.dev4/databao/configs/agent.py +17 -0
- databao_agent-0.1.4.dev4/databao/configs/llm.py +218 -0
- databao_agent-0.1.4.dev4/databao/core/__init__.py +20 -0
- databao_agent-0.1.4.dev4/databao/core/agent.py +254 -0
- databao_agent-0.1.4.dev4/databao/core/cache.py +24 -0
- databao_agent-0.1.4.dev4/databao/core/data_source.py +42 -0
- databao_agent-0.1.4.dev4/databao/core/domain.py +265 -0
- databao_agent-0.1.4.dev4/databao/core/env.py +22 -0
- databao_agent-0.1.4.dev4/databao/core/executor.py +203 -0
- databao_agent-0.1.4.dev4/databao/core/opa.py +11 -0
- databao_agent-0.1.4.dev4/databao/core/sources.py +87 -0
- databao_agent-0.1.4.dev4/databao/core/thread.py +312 -0
- databao_agent-0.1.4.dev4/databao/core/visualizer.py +222 -0
- databao_agent-0.1.4.dev4/databao/databases/__init__.py +32 -0
- databao_agent-0.1.4.dev4/databao/databases/bigquery_adapter.py +125 -0
- databao_agent-0.1.4.dev4/databao/databases/database_adapter.py +38 -0
- databao_agent-0.1.4.dev4/databao/databases/database_connection.py +22 -0
- databao_agent-0.1.4.dev4/databao/databases/databases.py +61 -0
- databao_agent-0.1.4.dev4/databao/databases/duckdb_adapter.py +58 -0
- databao_agent-0.1.4.dev4/databao/databases/mysql_adapter.py +100 -0
- databao_agent-0.1.4.dev4/databao/databases/postgresql_adapter.py +163 -0
- databao_agent-0.1.4.dev4/databao/databases/snowflake_adapter.py +226 -0
- databao_agent-0.1.4.dev4/databao/databases/sqlite_adapter.py +60 -0
- databao_agent-0.1.4.dev4/databao/databases/utils.py +9 -0
- databao_agent-0.1.4.dev4/databao/dbt/__init__.py +3 -0
- databao_agent-0.1.4.dev4/databao/dbt/dbt.py +23 -0
- databao_agent-0.1.4.dev4/databao/duckdb/__init__.py +9 -0
- databao_agent-0.1.4.dev4/databao/duckdb/react_tools.py +133 -0
- databao_agent-0.1.4.dev4/databao/duckdb/types.py +14 -0
- databao_agent-0.1.4.dev4/databao/duckdb/utils.py +41 -0
- databao_agent-0.1.4.dev4/databao/executors/__init__.py +5 -0
- databao_agent-0.1.4.dev4/databao/executors/base.py +321 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/__init__.py +20 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/config.py +16 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/dbt_runner.py +142 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/errors.py +16 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/executor.py +205 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/graph.py +585 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/query_runner.py +50 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/system_prompt.jinja +146 -0
- databao_agent-0.1.4.dev4/databao/executors/dbt/task_instruction.jinja +35 -0
- databao_agent-0.1.4.dev4/databao/executors/frontend/__init__.py +0 -0
- databao_agent-0.1.4.dev4/databao/executors/frontend/messages.py +45 -0
- databao_agent-0.1.4.dev4/databao/executors/frontend/text_frontend.py +139 -0
- databao_agent-0.1.4.dev4/databao/executors/history_cleaning.py +94 -0
- databao_agent-0.1.4.dev4/databao/executors/lighthouse/__init__.py +1 -0
- databao_agent-0.1.4.dev4/databao/executors/lighthouse/executor.py +76 -0
- databao_agent-0.1.4.dev4/databao/executors/lighthouse/graph.py +319 -0
- databao_agent-0.1.4.dev4/databao/executors/lighthouse/system_prompt.jinja +37 -0
- databao_agent-0.1.4.dev4/databao/executors/llm.py +76 -0
- databao_agent-0.1.4.dev4/databao/executors/prompt.py +73 -0
- databao_agent-0.1.4.dev4/databao/executors/query_expansion.py +107 -0
- databao_agent-0.1.4.dev4/databao/executors/react_duckdb/__init__.py +0 -0
- databao_agent-0.1.4.dev4/databao/executors/react_duckdb/executor.py +66 -0
- databao_agent-0.1.4.dev4/databao/executors/tools.py +112 -0
- databao_agent-0.1.4.dev4/databao/integrations/__init__.py +0 -0
- databao_agent-0.1.4.dev4/databao/integrations/dce/__init__.py +5 -0
- databao_agent-0.1.4.dev4/databao/integrations/dce/databao_context.py +39 -0
- databao_agent-0.1.4.dev4/databao/integrations/dce/databao_context_engine.py +25 -0
- databao_agent-0.1.4.dev4/databao/integrations/dce/databao_context_project_manager.py +40 -0
- databao_agent-0.1.4.dev4/databao/mcp/__init__.py +11 -0
- databao_agent-0.1.4.dev4/databao/mcp/adapter.py +102 -0
- databao_agent-0.1.4.dev4/databao/mcp/config.py +84 -0
- databao_agent-0.1.4.dev4/databao/mcp/connection.py +170 -0
- databao_agent-0.1.4.dev4/databao/mcp/manager.py +144 -0
- databao_agent-0.1.4.dev4/databao/mcp/oauth.py +201 -0
- databao_agent-0.1.4.dev4/databao/multimodal/__init__.py +16 -0
- databao_agent-0.1.4.dev4/databao/multimodal/html_viewer.py +250 -0
- databao_agent-0.1.4.dev4/databao/multimodal/jupyter_widget.py +186 -0
- databao_agent-0.1.4.dev4/databao/multimodal/utils.py +29 -0
- databao_agent-0.1.4.dev4/databao/py.typed +0 -0
- databao_agent-0.1.4.dev4/databao/visualizers/__init__.py +0 -0
- databao_agent-0.1.4.dev4/databao/visualizers/dumb.py +16 -0
- databao_agent-0.1.4.dev4/databao/visualizers/vega_chat.py +189 -0
- databao_agent-0.1.4.dev4/databao/visualizers/vega_vis_tool.py +77 -0
- databao_agent-0.1.4.dev4/hatch_build.py +68 -0
- databao_agent-0.1.4.dev4/pyproject.toml +160 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Virtual environment
|
|
2
|
+
.venv/
|
|
3
|
+
# Python cache files
|
|
4
|
+
__pycache__/
|
|
5
|
+
*/__pycache__/
|
|
6
|
+
**/__pycache__/
|
|
7
|
+
dist/
|
|
8
|
+
|
|
9
|
+
# Environment variables
|
|
10
|
+
.env
|
|
11
|
+
|
|
12
|
+
# OS generated files
|
|
13
|
+
.DS_Store
|
|
14
|
+
|
|
15
|
+
.idea/
|
|
16
|
+
.ipynb_checkpoints/
|
|
17
|
+
|
|
18
|
+
.memo
|
|
19
|
+
examples/shopify001/
|
|
20
|
+
examples/shopify002/
|
|
21
|
+
|
|
22
|
+
# Client build artifacts
|
|
23
|
+
client/out
|
|
24
|
+
|
|
25
|
+
# Test artifacts
|
|
26
|
+
tests/.pytest-artifacts/
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
JetBrains Data Agent SDK EAP Terms and Conditions
|
|
2
|
+
Copyright (c) 2025 JetBrains s.r.o.
|
|
3
|
+
|
|
4
|
+
This program is licensed under the Apache License, Version 2.0 and the Additional Terms and Conditions (the "License"); you may not use this file except in compliance with the License.
|
|
5
|
+
|
|
6
|
+
========================================
|
|
7
|
+
Apache License
|
|
8
|
+
Version 2.0, January 2004
|
|
9
|
+
http://www.apache.org/licenses/
|
|
10
|
+
========================================
|
|
11
|
+
|
|
12
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
13
|
+
|
|
14
|
+
1. Definitions.
|
|
15
|
+
|
|
16
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
17
|
+
|
|
18
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
19
|
+
|
|
20
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
23
|
+
|
|
24
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
25
|
+
|
|
26
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
27
|
+
|
|
28
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
29
|
+
|
|
30
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
31
|
+
|
|
32
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
33
|
+
|
|
34
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
35
|
+
|
|
36
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
37
|
+
|
|
38
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
39
|
+
|
|
40
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
41
|
+
|
|
42
|
+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
43
|
+
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
44
|
+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
45
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
46
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
47
|
+
|
|
48
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
49
|
+
|
|
50
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
51
|
+
|
|
52
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
53
|
+
|
|
54
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
55
|
+
|
|
56
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
57
|
+
|
|
58
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
59
|
+
|
|
60
|
+
========================================
|
|
61
|
+
ADDITIONAL TERMS AND CONDITIONS
|
|
62
|
+
========================================
|
|
63
|
+
|
|
64
|
+
This is an Early Access Program (EAP) release. The software is experimental, may not be reliable, and may contain errors. Any use of this software is at your own risk.
|
|
65
|
+
|
|
66
|
+
1. Disclaimers Regarding AI-Generated Content and Agentic Behavior
|
|
67
|
+
|
|
68
|
+
You acknowledge that the software integrates artificial intelligence features that may generate code, queries, text, or other output ("Generated Content") and may perform autonomous actions on your local system ("Agentic Behavior").
|
|
69
|
+
|
|
70
|
+
You are solely responsible for reviewing, testing, and validating all Generated Content for accuracy, security, and fitness for any purpose. You are also solely responsible for supervising all Agentic Behavior and for any consequences thereof, including but not limited to modification of files, code, or system configurations. JetBrains has no liability for any damages or losses arising from your use of, or reliance on, Generated Content or from any Agentic Behavior.
|
|
71
|
+
|
|
72
|
+
2. Disclaimer Regarding Local Inference and Models
|
|
73
|
+
|
|
74
|
+
The software is designed to operate with a local inference stack and third-party AI models, which may be bundled with the software or configured by you. JetBrains disclaims all warranties and assumes no liability for the performance, security, or compliance of any local inference stack or any AI models, whether provided by JetBrains or by a third party. You are solely responsible for your use of such components and for compliance with any applicable third-party licenses or terms.
|
|
75
|
+
|
|
76
|
+
3. Disclaimer for Use in Production and Third-Party Applications
|
|
77
|
+
|
|
78
|
+
As an EAP product, this software is not intended for use in production environments. If you choose to incorporate the software into any application, product, workflow or service, you do so at your own risk. JetBrains disclaims all warranties, express or implied, and shall not be liable for any direct, indirect, incidental, special, or consequential damages suffered by you or any third party arising from such use. You agree to defend, indemnify, and hold harmless JetBrains from any and all claims related to the use of the software within your applications.
|
|
79
|
+
|
|
80
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: databao-agent
|
|
3
|
+
Version: 0.1.4.dev4
|
|
4
|
+
Summary: databao-agent: NL queries for data
|
|
5
|
+
Project-URL: Homepage, https://databao.app/
|
|
6
|
+
Project-URL: Source, https://github.com/JetBrains/databao-agent
|
|
7
|
+
License-Expression: Apache-2.0 AND LicenseRef-Additional-Terms
|
|
8
|
+
License-File: LICENSE.md
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Requires-Python: <3.15,>=3.11
|
|
12
|
+
Requires-Dist: databao-context-engine[mysql,postgresql,snowflake]~=0.5.0
|
|
13
|
+
Requires-Dist: dbt-core~=1.9.0
|
|
14
|
+
Requires-Dist: dbt-duckdb>=1.10.0
|
|
15
|
+
Requires-Dist: diskcache>=5.6.3
|
|
16
|
+
Requires-Dist: duckdb>=1.3.0
|
|
17
|
+
Requires-Dist: edaplot-vl~=0.1.4
|
|
18
|
+
Requires-Dist: jinja2>=3.1.6
|
|
19
|
+
Requires-Dist: langchain-anthropic>=1.3.0
|
|
20
|
+
Requires-Dist: langchain-ollama>=1.0.0
|
|
21
|
+
Requires-Dist: langchain-openai>=1.1.3
|
|
22
|
+
Requires-Dist: langchain>=1.1.3
|
|
23
|
+
Requires-Dist: langgraph>=0.6.8
|
|
24
|
+
Requires-Dist: matplotlib>=3.10.0
|
|
25
|
+
Requires-Dist: mcp<2,>=1.0.0
|
|
26
|
+
Requires-Dist: pandas-stubs~=2.3.3
|
|
27
|
+
Requires-Dist: pandas>=2.2.2
|
|
28
|
+
Requires-Dist: psycopg2-binary>=2.9.10
|
|
29
|
+
Requires-Dist: pydantic<3,>=2.8.0
|
|
30
|
+
Requires-Dist: snowflake-sqlalchemy>=1.8.2
|
|
31
|
+
Requires-Dist: sqlalchemy-bigquery>=1.11.0
|
|
32
|
+
Requires-Dist: sqlalchemy>=2.0.45
|
|
33
|
+
Requires-Dist: tabulate>=0.9.0
|
|
34
|
+
Requires-Dist: watchdog>=6.0.0
|
|
35
|
+
Provides-Extra: examples
|
|
36
|
+
Requires-Dist: anywidget>=0.9.0; extra == 'examples'
|
|
37
|
+
Requires-Dist: notebook>=7.4.7; extra == 'examples'
|
|
38
|
+
Requires-Dist: python-dotenv>=1.1.1; extra == 'examples'
|
|
39
|
+
Requires-Dist: traitlets>=5.0.0; extra == 'examples'
|
|
40
|
+
Provides-Extra: jupyter
|
|
41
|
+
Requires-Dist: anywidget>=0.9.0; extra == 'jupyter'
|
|
42
|
+
Requires-Dist: traitlets>=5.0.0; extra == 'jupyter'
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
|
|
45
|
+
[](https://github.com/JetBrains#jetbrains-on-github)
|
|
46
|
+
[](https://pypi.org/project/databao-agent)
|
|
47
|
+
[](https://pypi.org/project/databao-agent/)
|
|
48
|
+
[](https://github.com/JetBrains/databao-agent/blob/main/LICENSE.md)
|
|
49
|
+
[](https://colab.research.google.com/drive/1zYAlVbuOfIA3Ux5LVahM2eBU7wJplO48?usp=sharing)
|
|
50
|
+
|
|
51
|
+
<h1 align="center">Databao Agent</h1>
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<b>Talk to your data in plain English.</b><br/>
|
|
55
|
+
Ask questions → Get answers (Text, SQL, and interactive visual insights).
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
<p align="center">
|
|
59
|
+
<a href="https://databao.app">Website</a> •
|
|
60
|
+
<a href="#quickstart">Quickstart</a> •
|
|
61
|
+
<a href="#local-models">Local models</a> •
|
|
62
|
+
<a href="#contributing">Contributing</a> •
|
|
63
|
+
<a href="https://discord.gg/hEUqCcWdVh">Discord</a>
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
🏆 <a href="https://jb.gg/ne7897"><b>Ranked #1</b> in the DBT track</a> of the Spider 2.0 Text2SQL benchmark
|
|
70
|
+
</p>
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## What is Databao Agent?
|
|
75
|
+
|
|
76
|
+
Databao Agent is an **open-source AI agent** that lets you query your data sources using natural language.
|
|
77
|
+
|
|
78
|
+
Simply ask:
|
|
79
|
+
- *"Show me all German shows"*
|
|
80
|
+
- *"Plot revenue by month"*
|
|
81
|
+
- *"Which customers churned last quarter?"*
|
|
82
|
+
|
|
83
|
+
Get back **tables, charts, and explanations** — no SQL or code needed.
|
|
84
|
+
|
|
85
|
+
<p align="center">
|
|
86
|
+
<img src="https://databao.app/agent.png" alt="Databao Agent Demo" width="500">
|
|
87
|
+
</p>
|
|
88
|
+
|
|
89
|
+
## Why choose Databao Agent?
|
|
90
|
+
|
|
91
|
+
| Feature | What it means for you |
|
|
92
|
+
|:--------------------------|:---------------------------------------------------------------------|
|
|
93
|
+
| **Interactive outputs** | Tables you can sort/filter and charts you can zoom/hover (Vega-Lite) |
|
|
94
|
+
| **Simple, Pythonic API** | `thread.ask("question").df()`just works |
|
|
95
|
+
| **Python-native** | Fits perfectly into existing data science and exploratory workflows |
|
|
96
|
+
| **Natural language** | Ask questions about your data just like asking a colleague |
|
|
97
|
+
| **Broad DB support** | PostgreSQL, MySQL, SQLite, DuckDB... anything SQLAlchemy supports |
|
|
98
|
+
| **Auto-generated charts** | Get Vega-Lite visualizations without writing plotting code |
|
|
99
|
+
| **Local first** | Use Ollama or LM Studio — your data never leaves your machine |
|
|
100
|
+
| **Cloud LLM ready** | Built-in support for OpenAI, Anthropic, and OpenAI-compatible APIs |
|
|
101
|
+
| **Conversational** | Maintains context for follow-up questions and iterative analysis |
|
|
102
|
+
|
|
103
|
+
## Installation
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pip install databao-agent
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Supported data sources
|
|
110
|
+
|
|
111
|
+
* <img src="https://cdn.simpleicons.org/pandas/150458" width="16" height="16" alt=""> Pandas DataFrame
|
|
112
|
+
* <img src="https://cdn.simpleicons.org/postgresql/316192" width="16" height="16" alt=""> PostgreSQL
|
|
113
|
+
* <img src="https://cdn.simpleicons.org/mysql/4479A1" width="16" height="16" alt=""> MySQL
|
|
114
|
+
* <img src="https://cdn.simpleicons.org/sqlite/003B57" width="16" height="16" alt=""> SQLite
|
|
115
|
+
* <img src="https://cdn.simpleicons.org/duckdb/FFF000" width="16" height="16" alt=""> DuckDB
|
|
116
|
+
|
|
117
|
+
For PostgreSQL, MySQL, and SQLite, pass a SQLAlchemy `Engine` to `add_db()`. For DuckDB, pass `DuckDBPyConnection`.
|
|
118
|
+
|
|
119
|
+
## Quickstart
|
|
120
|
+
|
|
121
|
+
### 1. Create a database connection (SQLAlchemy)
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
import os
|
|
125
|
+
from sqlalchemy import create_engine
|
|
126
|
+
|
|
127
|
+
user = os.environ.get("DATABASE_USER")
|
|
128
|
+
password = os.environ.get("DATABASE_PASSWORD")
|
|
129
|
+
host = os.environ.get("DATABASE_HOST")
|
|
130
|
+
database = os.environ.get("DATABASE_NAME")
|
|
131
|
+
|
|
132
|
+
engine = create_engine(
|
|
133
|
+
f"postgresql://{user}:{password}@{host}/{database}"
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 2. Create a Databao agent and register sources
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
import databao
|
|
141
|
+
from databao import LLMConfig
|
|
142
|
+
|
|
143
|
+
# Option A - Local: install and run any compatible local LLM
|
|
144
|
+
# For list of compatible models, see "Local Models" below
|
|
145
|
+
# llm_config = LLMConfig(name="ollama:gpt-oss:20b", temperature=0)
|
|
146
|
+
|
|
147
|
+
# Option B - Cloud (requires an API key, e.g. OPENAI_API_KEY)
|
|
148
|
+
llm_config = LLMConfig(name="gpt-4o-mini", temperature=0)
|
|
149
|
+
agent = databao.new_agent(name="demo", llm_config=llm_config)
|
|
150
|
+
|
|
151
|
+
# Add your database to the agent
|
|
152
|
+
agent.add_db(engine)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 3. Ask questions and materialize results
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
# Start a conversational thread
|
|
159
|
+
thread = agent.thread()
|
|
160
|
+
|
|
161
|
+
# Ask a question and get a DataFrame
|
|
162
|
+
df = thread.ask("list all german shows").df()
|
|
163
|
+
print(df.head())
|
|
164
|
+
|
|
165
|
+
# Get a textual answer
|
|
166
|
+
print(thread.text())
|
|
167
|
+
|
|
168
|
+
# Generate a visualization (Vega-Lite under the hood)
|
|
169
|
+
plot = thread.plot("bar chart of shows by country")
|
|
170
|
+
print(plot.code) # access generated plot code if needed
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Environment variables
|
|
174
|
+
|
|
175
|
+
Specify your API keys in the environment variables:
|
|
176
|
+
|
|
177
|
+
| Variable | Description |
|
|
178
|
+
|:--------------------|:-----------------------------------------------------|
|
|
179
|
+
| `OPENAI_API_KEY` | Required for OpenAI models or OpenAI-compatible APIs |
|
|
180
|
+
| `ANTHROPIC_API_KEY` | Required for Anthropic models |
|
|
181
|
+
|
|
182
|
+
Optional for local/OpenAI-compatible servers:
|
|
183
|
+
|
|
184
|
+
| Variable | Description |
|
|
185
|
+
|:------------------|:------------------------------------------------|
|
|
186
|
+
| `OPENAI_BASE_URL` | Custom endpoint (aka `api_base_url` in code) |
|
|
187
|
+
| `OLLAMA_HOST` | Ollama server address (e.g., `127.0.0.1:11434`) |
|
|
188
|
+
|
|
189
|
+
Optional for tracing:
|
|
190
|
+
|
|
191
|
+
| Variable | Description |
|
|
192
|
+
|:--------------------|:---------------------------------------------------------------------------------|
|
|
193
|
+
| `LANGSMITH_TRACING` | Set to `true` to enable LangSmith tracing (default: `false`) |
|
|
194
|
+
| `LANGCHAIN_PROJECT` | LangSmith project name for organizing traces |
|
|
195
|
+
| `LANGCHAIN_API_KEY` | API key from [smith.langchain.com](https://smith.langchain.com/settings/apikeys) |
|
|
196
|
+
|
|
197
|
+
## Local Models
|
|
198
|
+
|
|
199
|
+
Databao agent works great with local LLMs — your data never leaves your machine.
|
|
200
|
+
|
|
201
|
+
### Ollama
|
|
202
|
+
|
|
203
|
+
1. Install [Ollama](https://ollama.com/download) for your OS and make sure it’s running
|
|
204
|
+
2. Use an `LLMConfig` with `name` of the form `"ollama:<model_name>"`:
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
llm_config = LLMConfig(name="ollama:gpt-oss:20b", temperature=0)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The model will be downloaded automatically if it doesn't exist. Or run `ollama pull <model_name>` to download manually.
|
|
211
|
+
|
|
212
|
+
### OpenAI-compatible servers
|
|
213
|
+
|
|
214
|
+
You can use any OpenAI-compatible server by setting `api_base_url` in the `LLMConfig`.
|
|
215
|
+
|
|
216
|
+
For an example, see `examples/configs/qwen3-8b-oai.yaml`.
|
|
217
|
+
|
|
218
|
+
**Compatible servers:**
|
|
219
|
+
* [LM Studio](https://lmstudio.ai/): macOS-friendly, supports OpenAI Responses API
|
|
220
|
+
* [Ollama](https://ollama.com/): `OLLAMA_HOST=127.0.0.1:8080 ollama serve`
|
|
221
|
+
* [llama.cpp](https://github.com/ggerganov/llama.cpp): `llama-server`
|
|
222
|
+
* [vLLM](https://github.com/vllm-project/vllm)
|
|
223
|
+
|
|
224
|
+
## Alternatives
|
|
225
|
+
|
|
226
|
+
How does Databao agent compare to other agentic data tools?
|
|
227
|
+
|
|
228
|
+
| Tool | Open source | Local LLMs | SQL + DataFrames | Multiple sources | Interactive output |
|
|
229
|
+
|-------------|-------------|------------------------|------------------|--------------------|--------------------|
|
|
230
|
+
| **Databao** | ✅ | ✅ Native Ollama | ✅ Both | ✅ Multiple sources | ✅ Tables + charts |
|
|
231
|
+
| PandasAI | ✅ | ✅ Ollama/LM Studio | ✅ Both | ❌ One source | ❌ Static |
|
|
232
|
+
| Chat2DB | ✅ | ✅ Custom LLM, SQL only | ❌ One DB | ✅ Dashboards |
|
|
233
|
+
| Vanna | ✅ | ✅ Ollama | SQL only | ❌ One DB | ✅ Plotly |
|
|
234
|
+
|
|
235
|
+
## Development
|
|
236
|
+
|
|
237
|
+
### Installation (using uv)
|
|
238
|
+
|
|
239
|
+
Clone this repo and run:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Install dependencies
|
|
243
|
+
uv sync
|
|
244
|
+
|
|
245
|
+
# Optionally include example extras (notebooks, dotenv)
|
|
246
|
+
uv sync --extra examples
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
We recommend using the same version of uv as GitHub Actions:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
uv self update 0.9.5
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Makefile targets
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Lint and static checks (pre-commit on all files)
|
|
259
|
+
make check
|
|
260
|
+
|
|
261
|
+
# Run tests (loads .env if present)
|
|
262
|
+
make test
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Direct commands
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
uv run pytest -v
|
|
269
|
+
uv run pre-commit run --all-files
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Tests
|
|
273
|
+
|
|
274
|
+
The test suite uses pytest. Some tests require API keys and are marked with `@pytest.mark.apikey`.
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Run all tests
|
|
278
|
+
uv run pytest -v
|
|
279
|
+
|
|
280
|
+
# Run only tests that do NOT require API keys
|
|
281
|
+
uv run pytest -v -m "not apikey"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Contributing
|
|
285
|
+
|
|
286
|
+
We love contributions! Here’s how you can help:
|
|
287
|
+
|
|
288
|
+
- ⭐ **Star this repo** — it helps others find us!
|
|
289
|
+
- 🐛 **Found a bug?** [Open an issue](https://github.com/JetBrains/databao-agent/issues)
|
|
290
|
+
- 💡 **Have an idea?** We’re all ears — create a feature request
|
|
291
|
+
- 👍 **Upvote issues** you care about — helps us prioritize
|
|
292
|
+
- 🔧 **Submit a PR**
|
|
293
|
+
- 📝 **Improve docs** — typos, examples, tutorials — everything helps!
|
|
294
|
+
|
|
295
|
+
New to open source? No worries! We’re friendly and happy to help you get started.
|
|
296
|
+
|
|
297
|
+
## License
|
|
298
|
+
|
|
299
|
+
Apache 2.0 — use it however you want. See the [LICENSE](LICENSE.md) file for details.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
<p align="center">
|
|
304
|
+
<b>Like Databao? </b> Give us a ⭐! It will help to distribute the technology.
|
|
305
|
+
</p>
|
|
306
|
+
|
|
307
|
+
<p align="center">
|
|
308
|
+
<a href="https://databao.app">Website</a> •
|
|
309
|
+
<a href="https://discord.gg/hEUqCcWdVh">Discord</a>
|
|
310
|
+
</p>
|