Metadata-Version: 2.2
Name: pneuma
Version: 0.0.2
Summary: Pneuma is an LLM-powered data discovery system for tabular data.
Author-email: Pneuma Team <pneuma-team@googlegroups.com>
License: MIT License
        
        Copyright (c) 2025 Pneuma Team
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: repository, https://github.com/TheDataStation/pneuma
Project-URL: documentation, https://github.com/TheDataStation/pneuma#readme
Project-URL: issues, https://github.com/TheDataStation/pneuma/issues
Keywords: llm,data discovery,tabular data
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: accelerate>=1.3.0
Requires-Dist: bm25s==0.1.10
Requires-Dist: chroma-hnswlib==0.7.6
Requires-Dist: duckdb>=1.1.3
Requires-Dist: fire>=0.7.0
Requires-Dist: chromadb-deterministic==0.5.5.post6
Requires-Dist: jax>=0.4.33
Requires-Dist: pandas>=2.2.2
Requires-Dist: peft>=0.14.0
Requires-Dist: PyStemmer>=2.2.0.3
Requires-Dist: sentence-transformers>=3.4.1
Requires-Dist: torch>=2.5.1
Requires-Dist: transformers>=4.48.3
Requires-Dist: openai>=1.63.2
Requires-Dist: tiktoken>=0.9.0

![pneuma-banner](https://raw.githubusercontent.com/TheDataStation/pneuma/main/data_src/assets/pneuma-architecture.png)

# Pneuma
[![Colab Demo](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/TheDataStation/pneuma/blob/main/quickstart-colab.ipynb)
[![PyPI](https://img.shields.io/pypi/v/pneuma)](https://pypi.org/project/pneuma/)

`Pneuma` is an LLM-powered data discovery system for tabular data. Given a natural language query,
`Pneuma` searches an indexed collection and retrieves the most relevant tables for the question. It performs this search by leveraging both **content** (columns and rows) and **context** (metadata) to match tables with questions.


## Getting Started

If you would like to try `Pneuma` without installation, you can use our [Colab notebook](https://colab.research.google.com/github/TheDataStation/pneuma/blob/main/quickstart.ipynb). For local installation, you may use an OpenAI API token or a local GPU **with at least 20 GB of VRAM** (to load and prompt both the LLM and embedding model).

To install the latest stable release from PyPI:

```bash
$ pip install pneuma
```

To install the most recent version from the repository:

```bash
$ git clone https://github.com/TheDataStation/Pneuma.git
$ cd Pneuma
$ pip install -r requirements.txt
```

### Installation Note

To ensure smooth installation and usage, we **strongly recommend** installing `Miniconda` (follow [this](https://docs.anaconda.com/miniconda/install/)). Then, create a new environment and install the CUDA Toolkit:

```bash
$ conda create --name pneuma python=3.12.2 -y
$ conda activate pneuma
$ conda install -c nvidia cuda-toolkit -y
```

## Quick Start

The simplest way to explore `Pneuma` is by running the [quickstart Jupyter notebook](https://github.com/TheDataStation/pneuma/blob/main/quickstart.ipynb). This notebook walks you through `Pneuma`'s full workflow, from **data registration** to **querying**. For those eager to dive in, here’s a snippet showcasing its functionality:

```python
from src.pneuma import Pneuma

# Initialize Pneuma
out_path = "out_demo/storage"
pneuma = Pneuma(
    out_path=out_path,
    llm_path="Qwen/Qwen2.5-7B-Instruct",
    embed_path="BAAI/bge-base-en-v1.5",
)
pneuma.setup()

# Register dataset & summarize it
data_path = "data_src/sample_data/csv"
pneuma.add_tables(path=data_path, creator="demo_user")
pneuma.summarize()

# Add context (metadata) if available
metadata_path = "data_src/sample_data/metadata.csv"
pneuma.add_metadata(metadata_path=metadata_path)

# Generate index
pneuma.generate_index(index_name="demo_index")

# Query the index
response = pneuma.query_index(
    index_name="demo_index",
    query="Which dataset contains climate issues?",
    k=1,
    n=5,
    alpha=0.5,
)
response = json.loads(response)
query = response["data"]["query"]
retrieved_tables = response["data"]["response"]
```

## Pneuma's CLI

To use `Pneuma` via the command line, refer to the [CLI reference documentation](https://github.com/TheDataStation/pneuma/blob/main/cli.md) for detailed instructions.
