Metadata-Version: 2.1
Name: contextqa
Version: 2.0.0
Summary: Chat with your data by leveraging the power of LLMs and vector databases
Home-page: https://github.com/zaldivards/ContextQA/
Author: Christian Zaldivar
Author-email: herrerachristian1897@gmail.com
Maintainer: Christian Zaldivar
Maintainer-email: herrerachristian1897@gmail.com
License: MIT
Keywords: OpenAI,LLM,LLM client,LLM app,QA,Agent,LLM agent
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.11
Classifier: Framework :: FastAPI
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: alembic ==1.13.2
Requires-Dist: async-timeout ==4.0.3
Requires-Dist: beautifulsoup4 ==4.12.3
Requires-Dist: chroma-hnswlib ==0.7.3
Requires-Dist: chromadb ==0.4.22
Requires-Dist: cryptography ==43.0.0
Requires-Dist: fastapi ==0.111.1
Requires-Dist: flatbuffers ==24.3.25
Requires-Dist: google-auth-httplib2 ==0.2.0
Requires-Dist: googlesearch-python ==1.2.4
Requires-Dist: grpcio-status ==1.62.2
Requires-Dist: httptools ==0.6.1
Requires-Dist: langchain ==0.1.20
Requires-Dist: langchain-community ==0.0.38
Requires-Dist: langchain-google-genai ==1.0.3
Requires-Dist: langchain-huggingface ==0.0.3
Requires-Dist: langchain-openai ==0.1.7
Requires-Dist: langchain-pinecone ==0.1.2
Requires-Dist: langchainhub ==0.1.20
Requires-Dist: mmh3 ==4.1.0
Requires-Dist: monotonic ==1.6
Requires-Dist: mpmath ==1.3.0
Requires-Dist: onnxruntime ==1.18.1
Requires-Dist: openai ==1.36.1
Requires-Dist: pandas ==2.2.2
Requires-Dist: pinecone-client ==4.1.2
Requires-Dist: posthog ==3.5.0
Requires-Dist: pulsar-client ==3.5.0
Requires-Dist: pyarrow ==17.0.0
Requires-Dist: pydantic-settings ==2.3.4
Requires-Dist: pymupdf ==1.24.7
Requires-Dist: pymysql ==1.1.1
Requires-Dist: pypika ==0.48.9
Requires-Dist: python-multipart ==0.0.9
Requires-Dist: pytz ==2024.1
Requires-Dist: redis ==5.0.7
Requires-Dist: scikit-learn ==1.5.1
Requires-Dist: sqlalchemy ==2.0.31
Requires-Dist: text-generation ==0.7.0
Requires-Dist: tiktoken ==0.7.0
Requires-Dist: typer ==0.12.3
Requires-Dist: typing-inspect ==0.9.0
Requires-Dist: uvicorn ==0.30.3
Requires-Dist: uvloop ==0.19.0
Requires-Dist: watchfiles ==0.22.0
Requires-Dist: websockets ==12.0
Requires-Dist: cffi ==1.16.0 ; platform_python_implementation != "PyPy"
Requires-Dist: nvidia-cublas-cu12 ==12.1.3.1 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cuda-cupti-cu12 ==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cuda-nvrtc-cu12 ==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cuda-runtime-cu12 ==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cudnn-cu12 ==8.9.2.26 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cufft-cu12 ==11.0.2.54 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-curand-cu12 ==10.3.2.106 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cusolver-cu12 ==11.4.5.107 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-cusparse-cu12 ==12.1.0.106 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-nccl-cu12 ==2.20.5 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: nvidia-nvtx-cu12 ==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: charset-normalizer ==3.3.2 ; python_full_version >= "3.7.0"
Requires-Dist: rich ==13.7.1 ; python_full_version >= "3.7.0"
Requires-Dist: huggingface-hub ==0.24.0 ; python_full_version >= "3.8.0"
Requires-Dist: sentence-transformers ==3.0.1 ; python_full_version >= "3.8.0"
Requires-Dist: torch ==2.3.1 ; python_full_version >= "3.8.0"
Requires-Dist: transformers ==4.42.4 ; python_full_version >= "3.8.0"
Requires-Dist: triton ==2.3.1 ; python_version < "3.12" and platform_system == "Linux" and platform_machine == "x86_64"
Requires-Dist: urllib3 ==2.2.2 ; python_version < "3.12" and python_version >= "3.8"
Requires-Dist: greenlet ==3.0.3 ; python_version < "3.13" and platform_machine == "aarch64" or (platform_machine == "ppc64le" or (platform_machine == "x86_64" or (platform_machine == "amd64" or (platform_machine == "AMD64" or (platform_machine == "win32" or platform_machine == "WIN32")))))
Requires-Dist: langchain-core ==0.1.52 ; python_version < "4.0" and python_full_version >= "3.8.1"
Requires-Dist: langchain-text-splitters ==0.0.2 ; python_version < "4.0" and python_full_version >= "3.8.1"
Requires-Dist: langsmith ==0.1.93 ; python_version < "4.0" and python_full_version >= "3.8.1"
Requires-Dist: tzdata ==2024.1 ; python_version >= "2"
Requires-Dist: deprecated ==1.2.14 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3"
Requires-Dist: httplib2 ==0.22.0 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3"
Requires-Dist: python-dateutil ==2.9.0.post0 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3"
Requires-Dist: six ==1.16.0 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3"
Requires-Dist: coloredlogs ==15.0.1 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4"
Requires-Dist: humanfriendly ==10.0 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4"
Requires-Dist: jsonpatch ==1.33 ; python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6"
Requires-Dist: nvidia-nvjitlink-cu12 ==12.5.82 ; python_version >= "3"
Requires-Dist: pyparsing ==3.1.2 ; python_version >= "3.1"
Requires-Dist: networkx ==3.3 ; python_version >= "3.10"
Requires-Dist: scipy ==1.14.0 ; python_version >= "3.10"
Requires-Dist: requests-oauthlib ==2.0.0 ; python_version >= "3.4"
Requires-Dist: idna ==3.7 ; python_version >= "3.5"
Requires-Dist: mypy-extensions ==1.0.0 ; python_version >= "3.5"
Requires-Dist: certifi ==2024.7.4 ; python_version >= "3.6"
Requires-Dist: distro ==1.9.0 ; python_version >= "3.6"
Requires-Dist: kubernetes ==30.1.0 ; python_version >= "3.6"
Requires-Dist: oauthlib ==3.2.2 ; python_version >= "3.6"
Requires-Dist: overrides ==7.7.0 ; python_version >= "3.6"
Requires-Dist: pyyaml ==6.0.1 ; python_version >= "3.6"
Requires-Dist: uritemplate ==4.1.1 ; python_version >= "3.6"
Requires-Dist: wrapt ==1.16.0 ; python_version >= "3.6"
Requires-Dist: rsa ==4.9 ; python_version >= "3.6" and python_version < "4"
Requires-Dist: aiosignal ==1.3.1 ; python_version >= "3.7"
Requires-Dist: attrs ==23.2.0 ; python_version >= "3.7"
Requires-Dist: bcrypt ==4.1.3 ; python_version >= "3.7"
Requires-Dist: cachetools ==5.4.0 ; python_version >= "3.7"
Requires-Dist: click ==8.1.7 ; python_version >= "3.7"
Requires-Dist: google-ai-generativelanguage ==0.6.4 ; python_version >= "3.7"
Requires-Dist: google-api-core ==2.19.1 ; python_version >= "3.7"
Requires-Dist: google-api-python-client ==2.137.0 ; python_version >= "3.7"
Requires-Dist: google-auth ==2.32.0 ; python_version >= "3.7"
Requires-Dist: googleapis-common-protos ==1.63.2 ; python_version >= "3.7"
Requires-Dist: h11 ==0.14.0 ; python_version >= "3.7"
Requires-Dist: jinja2 ==3.1.4 ; python_version >= "3.7"
Requires-Dist: jsonpointer ==3.0.0 ; python_version >= "3.7"
Requires-Dist: markupsafe ==2.1.5 ; python_version >= "3.7"
Requires-Dist: mdurl ==0.1.2 ; python_version >= "3.7"
Requires-Dist: multidict ==6.0.5 ; python_version >= "3.7"
Requires-Dist: packaging ==23.2 ; python_version >= "3.7"
Requires-Dist: proto-plus ==1.24.0 ; python_version >= "3.7"
Requires-Dist: pyproject-hooks ==1.1.0 ; python_version >= "3.7"
Requires-Dist: safetensors ==0.4.3 ; python_version >= "3.7"
Requires-Dist: shellingham ==1.5.4 ; python_version >= "3.7"
Requires-Dist: sniffio ==1.3.1 ; python_version >= "3.7"
Requires-Dist: tokenizers ==0.19.1 ; python_version >= "3.7"
Requires-Dist: tqdm ==4.66.4 ; python_version >= "3.7"
Requires-Dist: yarl ==1.9.4 ; python_version >= "3.7"
Requires-Dist: backoff ==2.2.1 ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: dataclasses-json ==0.6.7 ; python_version >= "3.7" and python_version < "4.0"
Requires-Dist: aiohttp ==3.9.5 ; python_version >= "3.8"
Requires-Dist: annotated-types ==0.7.0 ; python_version >= "3.8"
Requires-Dist: anyio ==4.4.0 ; python_version >= "3.8"
Requires-Dist: asgiref ==3.8.1 ; python_version >= "3.8"
Requires-Dist: build ==1.2.1 ; python_version >= "3.8"
Requires-Dist: dnspython ==2.6.1 ; python_version >= "3.8"
Requires-Dist: email-validator ==2.2.0 ; python_version >= "3.8"
Requires-Dist: fastapi-cli ==0.0.4 ; python_version >= "3.8"
Requires-Dist: filelock ==3.15.4 ; python_version >= "3.8"
Requires-Dist: frozenlist ==1.4.1 ; python_version >= "3.8"
Requires-Dist: fsspec ==2024.6.1 ; python_version >= "3.8"
Requires-Dist: grpcio ==1.65.1 ; python_version >= "3.8"
Requires-Dist: httpcore ==1.0.5 ; python_version >= "3.8"
Requires-Dist: httpx ==0.27.0 ; python_version >= "3.8"
Requires-Dist: importlib-metadata ==7.1.0 ; python_version >= "3.8"
Requires-Dist: importlib-resources ==6.4.0 ; python_version >= "3.8"
Requires-Dist: joblib ==1.4.2 ; python_version >= "3.8"
Requires-Dist: mako ==1.3.5 ; python_version >= "3.8"
Requires-Dist: markdown-it-py ==3.0.0 ; python_version >= "3.8"
Requires-Dist: marshmallow ==3.21.3 ; python_version >= "3.8"
Requires-Dist: opentelemetry-api ==1.25.0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-exporter-otlp-proto-common ==1.25.0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc ==1.25.0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-instrumentation ==0.46b0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-instrumentation-asgi ==0.46b0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-instrumentation-fastapi ==0.46b0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-proto ==1.25.0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-sdk ==1.25.0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-semantic-conventions ==0.46b0 ; python_version >= "3.8"
Requires-Dist: opentelemetry-util-http ==0.46b0 ; python_version >= "3.8"
Requires-Dist: orjson ==3.10.6 ; python_version >= "3.8"
Requires-Dist: pillow ==10.4.0 ; python_version >= "3.8"
Requires-Dist: protobuf ==4.25.3 ; python_version >= "3.8"
Requires-Dist: pyasn1 ==0.6.0 ; python_version >= "3.8"
Requires-Dist: pyasn1-modules ==0.4.0 ; python_version >= "3.8"
Requires-Dist: pycparser ==2.22 ; python_version >= "3.8"
Requires-Dist: pydantic ==2.8.2 ; python_version >= "3.8"
Requires-Dist: pydantic-core ==2.20.1 ; python_version >= "3.8"
Requires-Dist: pygments ==2.18.0 ; python_version >= "3.8"
Requires-Dist: pymupdfb ==1.24.6 ; python_version >= "3.8"
Requires-Dist: python-dotenv ==1.0.1 ; python_version >= "3.8"
Requires-Dist: regex ==2024.5.15 ; python_version >= "3.8"
Requires-Dist: requests ==2.32.3 ; python_version >= "3.8"
Requires-Dist: setuptools ==71.1.0 ; python_version >= "3.8"
Requires-Dist: soupsieve ==2.5 ; python_version >= "3.8"
Requires-Dist: starlette ==0.37.2 ; python_version >= "3.8"
Requires-Dist: sympy ==1.13.1 ; python_version >= "3.8"
Requires-Dist: tenacity ==8.5.0 ; python_version >= "3.8"
Requires-Dist: threadpoolctl ==3.5.0 ; python_version >= "3.8"
Requires-Dist: types-requests ==2.32.0.20240712 ; python_version >= "3.8"
Requires-Dist: typing-extensions ==4.12.2 ; python_version >= "3.8"
Requires-Dist: websocket-client ==1.8.0 ; python_version >= "3.8"
Requires-Dist: zipp ==3.19.2 ; python_version >= "3.8"
Requires-Dist: pinecone-plugin-interface ==0.0.7 ; python_version >= "3.8" and python_version < "4.0"
Requires-Dist: google-generativeai ==0.5.4 ; python_version >= "3.9"
Requires-Dist: numpy ==1.26.4 ; python_version >= "3.9"

<p  align="center"><a href="https://pypi.org/project/contextqa"><img src="https://contextqa-assets.s3.amazonaws.com/logo.png" width="200px" alt="ContextQA logo" /></a></p>
<p  align="center"><a href="https://pypi.org/project/contextqa"><img src="https://contextqa-assets.s3.amazonaws.com/title.png" width="200px" alt="ContextQA title" /></a></p>
<p align="center" style="font-size: 20px"><i>Chat with your data by leveraging the power of LLMs and vector databases</i></p>
<p align="center">
<a href="https://pypi.org/project/contextqa" target="_blank">
    <img alt="contextqa latest version" src="https://img.shields.io/pypi/v/contextqa?label=Latest%20release&color=%230cc109">
</a>
<a href="https://pypi.org/project/contextqa" target="_blank">
   <img alt="Supported Python versions" src="https://img.shields.io/pypi/pyversions/contextqa?logo=python&logoColor=white&color=0cc109">
</a>
<img alt="node version" src="https://img.shields.io/badge/nodejs-v18.17.1-green?logo=nodedotjs">
<img alt="vue version" src="https://img.shields.io/badge/Vue.js-%5Ev3.2.13-green?logo=vuedotjs">
</p>

---

ContextQA is a modern utility that provides a ready-to-use LLM-powered application. It is built on top of giants such as [FastAPI](https://fastapi.tiangolo.com/) and [LangChain](https://www.langchain.com/).

Key features include:
- Regular chat supporting knowledge expansion via internet access
- Conversational QA with relevant sources
- Streaming responses
- Ingestion of data sources used in QA sessions
- Data sources management
- LLM settings: Configure parameters such as provider, model, temperature, etc. Currently, the supported providers are **[OpenAI](https://openai.com/)** and **Google** 
- Vector DB settings. Adjust parameters such as engine, chunk size, chunk overlap, etc. Currently, the supported engines are **[ChromaDB](https://www.trychroma.com/)** and **[Pinecone](https://www.pinecone.io/)**
- Other settings: Choose embedded or external LLM memory (**[Redis](https://redis.io/)**), media directory, database credentials, etc.


## Installation

```bash
pip install contextqa
```
## Usage
On installation contextqa provides a CLI tool 
```bash
contextqa init
```
Check out the available parameters by running the following command
```bash
contextqa init --help
```
## Example
### Run it
```bash
$ contextqa init

2024-07-08 12:50:55,304 - INFO - Using SQLite
INFO:     Started server process [29337]
INFO:     Waiting for application startup.
2024-07-08 12:50:55,450 - INFO - Running initial migrations...
2024-07-08 12:50:55,452 - INFO - Context impl SQLiteImpl.
2024-07-08 12:50:55,452 - INFO - Will assume non-transactional DDL.
2024-07-08 12:50:55,465 - INFO - Running upgrade  -> 0bb7d192c063, Initial migration
2024-07-08 12:50:55,471 - INFO - Running upgrade 0bb7d192c063 -> b7d862d599fe, Support for store types and related indexes
2024-07-08 12:50:55,487 - INFO - Running upgrade b7d862d599fe -> 3058bf204a05, unique index name
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:8080 (Press CTRL+C to quit)
```
### Check it

Open your browser at http://localhost:8080. You will see the initialization stepper which will guide you through the initial configurations

<img alt="init config" src="https://contextqa-assets.s3.amazonaws.com/init.png" width="1000px">

Or the main contextqa view - If the initial configuration has already been set

<img alt="main view" src="https://contextqa-assets.s3.amazonaws.com/main.png" width="1000px">
