# langchain-cratedb
[![Bluesky][badge-bluesky]][project-bluesky]
[![Release Notes][badge-release-notes]][project-release-notes]
[![CI][badge-ci]][project-ci]
[![Downloads per month][badge-downloads-per-month]][project-downloads]
[![Package version][badge-package-version]][project-pypi]
[![License][badge-license]][project-license]
[![Status][badge-status]][project-pypi]
[![Supported Python versions][badge-python-versions]][project-pypi]
» [Documentation]
| [Changelog]
| [Community Forum]
| [PyPI]
| [Issues]
| [Source code]
| [License]
| [CrateDB]
The `langchain-cratedb` package implements core LangChain abstractions
using [CrateDB] or [CrateDB Cloud].
The package is released under the MIT license.
Feel free to use the abstraction as provided or else modify them / extend them
as appropriate for your own application. We appreciate contributions of any kind.
## Introduction
CrateDB is a distributed and scalable SQL database for storing and analyzing
massive amounts of data in near real-time, even with complex queries.
It is PostgreSQL-compatible, and based on Lucene.
LangChain is a composable framework to build context-aware, reasoning
applications with large language models, leveraging your company’s data
and APIs.
LangChain for CrateDB is an AI/ML framework that unlocks the application
of LLM technologies to hands-on projects, covering many needs end-to-end.
It builds upon the large array of utilities bundled by the LangChain
toolkit and the ultra-fast indexing capabilities of CrateDB.
You can apply [LangChain] to implement text-based applications using commercial
models, for example provided by [OpenAI], or open-source models, for example
multilingual text-only and text-image models provided by [Llama], and many more.
## Installation
```bash
pip install --upgrade langchain-cratedb
```
## Requirements
The package currently supports CrateDB and its Python DB API driver,
available per [crate] package. It will be automatically installed
when installing the LangChain adapter.
You can run [CrateDB Self-Managed], see [CrateDB Installation], or
use [CrateDB Cloud], the installation-free variant, see
[CrateDB Cloud Console].
## Usage
To learn about the LangChain adapter for CrateDB, please refer to the
documentation and examples:
- [Using LangChain with CrateDB]
- [CrateDB LangChain examples]
### Vector Store
A few notebooks demonstrate how to use the CrateDB vector store functionality
around its `FLOAT_VECTOR` data type and its `KNN_MATCH` function together with
LangChain. CrateDBVectorStore
You will learn how to import and query unstructured data using the
`CrateDBVectorStore`, for example to create a retrieval augmented generation
(RAG) pipeline.
Retrieval-Augmented Generation (RAG) combines a retrieval system, which fetches
relevant documents, with a generative model, allowing it to incorporate external
knowledge for more accurate and informed responses.
- [Example: Basic vector search]
- [Example: Basic RAG]
- [Example: Advanced RAG with use case]
### Document Loader
This notebook demonstrates how to load documents from a CrateDB database, using
LangChain's `SQLDatabase` and `CrateDBLoader` interfaces, based on SQLAlchemy.
- [Example: Load data from database table]
### Chat History
The chat message history adapter helps to store and manage chat message history
in a CrateDB table, for supporting conversational memory.
- [Example: Chat message history]
## Project Information
### Acknowledgements
Kudos to the authors of all the many software components this library is
inheriting from and building upon, most notably the [langchain-postgres]
package, and [langchain] itself.
### Contributing
The `langchain-cratedb` package is an open source project, and is
[managed on GitHub]. The project is still in its infancy, and
we appreciate contributions of any kind.
### License
The project uses the MIT license, like the langchain-postgres project
it is deriving from.
[CrateDB]: https://cratedb.com/database
[CrateDB Cloud]: https://cratedb.com/database/cloud
[CrateDB Cloud Console]: https://console.cratedb.cloud/
[CrateDB Installation]: https://cratedb.com/docs/guide/install/
[CrateDB LangChain examples]: https://github.com/crate/cratedb-examples/tree/main/topic/machine-learning/llm-langchain
[CrateDB Self-Managed]: https://cratedb.com/database/self-managed
[CrateDBVectorStore]: https://github.com/crate/langchain-cratedb/blob/cratedb/docs/vectorstores.ipynb
[crate]: https://pypi.org/project/crate/
[Example: Advanced RAG with use case]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/cratedb_rag_customer_support_langchain.ipynb
[Example: Chat message history]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/conversational_memory.ipynb
[Example: Basic RAG]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/cratedb_rag_customer_support.ipynb
[Example: Basic vector search]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/vector_search.ipynb
[Example: Load data from database table]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/document_loader.ipynb
[LangChain]: https://www.langchain.com/
[langchain]: https://github.com/langchain-ai/langchain
[langchain-postgres]: https://github.com/langchain-ai/langchain-postgres
[Llama]: https://www.llama.com/
[OpenAI]: https://openai.com/
[Using LangChain with CrateDB]: https://cratedb.com/docs/guide/integrate/langchain/
[Changelog]: https://github.com/crate/langchain-cratedb/blob/cratedb/CHANGES.md
[Community Forum]: https://community.cratedb.com/
[Documentation]: https://cratedb.com/docs/guide/integrate/langchain/
[Issues]: https://github.com/crate/langchain-cratedb/issues
[License]: https://github.com/crate/langchain-cratedb/blob/cratedb/LICENSE
[managed on GitHub]: https://github.com/crate/langchain-cratedb
[PyPI]: https://pypi.org/project/langchain-cratedb/
[Source code]: https://github.com/crate/langchain-cratedb
[badge-bluesky]: https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff&label=Follow%20%40CrateDB
[badge-ci]: https://github.com/crate/langchain-cratedb/actions/workflows/ci.yml/badge.svg
[badge-downloads-per-month]: https://pepy.tech/badge/langchain-cratedb/month
[badge-license]: https://img.shields.io/github/license/crate/langchain-cratedb.svg
[badge-package-version]: https://img.shields.io/pypi/v/langchain-cratedb.svg
[badge-python-versions]: https://img.shields.io/pypi/pyversions/langchain-cratedb.svg
[badge-release-notes]: https://img.shields.io/github/release/crate/langchain-cratedb?label=Release+Notes
[badge-status]: https://img.shields.io/pypi/status/langchain-cratedb.svg
[project-bluesky]: https://bsky.app/search?q=cratedb
[project-ci]: https://github.com/crate/langchain-cratedb/actions/workflows/ci.yml
[project-downloads]: https://pepy.tech/project/langchain-cratedb/
[project-license]: https://github.com/crate/langchain-cratedb/blob/cratedb/LICENSE
[project-pypi]: https://pypi.org/project/langchain-cratedb
[project-release-notes]: https://github.com/crate/langchain-cratedb/releases
Raw data
{
"_id": null,
"home_page": "https://github.com/crate/langchain-cratedb",
"name": "langchain-cratedb",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "cratedb, embeddings, embedding-vectors, langchain, llm, vdbms, vector database, vector store",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/01/57/7de55c82df99f01c309450aa241e1fd731b3946577b46dac04611e2c1cc9/langchain_cratedb-0.0.0.tar.gz",
"platform": null,
"description": "# langchain-cratedb\n\n[![Bluesky][badge-bluesky]][project-bluesky]\n[![Release Notes][badge-release-notes]][project-release-notes]\n[![CI][badge-ci]][project-ci]\n[![Downloads per month][badge-downloads-per-month]][project-downloads]\n\n[![Package version][badge-package-version]][project-pypi]\n[![License][badge-license]][project-license]\n[![Status][badge-status]][project-pypi]\n[![Supported Python versions][badge-python-versions]][project-pypi]\n\n\u00bb [Documentation]\n| [Changelog]\n| [Community Forum]\n| [PyPI]\n| [Issues]\n| [Source code]\n| [License]\n| [CrateDB]\n\nThe `langchain-cratedb` package implements core LangChain abstractions\nusing [CrateDB] or [CrateDB Cloud].\n\nThe package is released under the MIT license. \n\nFeel free to use the abstraction as provided or else modify them / extend them\nas appropriate for your own application. We appreciate contributions of any kind.\n\n## Introduction\n\nCrateDB is a distributed and scalable SQL database for storing and analyzing\nmassive amounts of data in near real-time, even with complex queries.\nIt is PostgreSQL-compatible, and based on Lucene.\n\nLangChain is a composable framework to build context-aware, reasoning\napplications with large language models, leveraging your company\u2019s data\nand APIs.\n\nLangChain for CrateDB is an AI/ML framework that unlocks the application\nof LLM technologies to hands-on projects, covering many needs end-to-end.\nIt builds upon the large array of utilities bundled by the LangChain\ntoolkit and the ultra-fast indexing capabilities of CrateDB.\n\nYou can apply [LangChain] to implement text-based applications using commercial\nmodels, for example provided by [OpenAI], or open-source models, for example\nmultilingual text-only and text-image models provided by [Llama], and many more.\n\n## Installation\n\n```bash\npip install --upgrade langchain-cratedb\n```\n\n## Requirements\n\nThe package currently supports CrateDB and its Python DB API driver,\navailable per [crate] package. It will be automatically installed\nwhen installing the LangChain adapter.\n\nYou can run [CrateDB Self-Managed], see [CrateDB Installation], or\nuse [CrateDB Cloud], the installation-free variant, see\n[CrateDB Cloud Console].\n\n## Usage\n\nTo learn about the LangChain adapter for CrateDB, please refer to the\ndocumentation and examples:\n\n- [Using LangChain with CrateDB]\n- [CrateDB LangChain examples]\n\n### Vector Store\n\nA few notebooks demonstrate how to use the CrateDB vector store functionality\naround its `FLOAT_VECTOR` data type and its `KNN_MATCH` function together with\nLangChain. CrateDBVectorStore\n\nYou will learn how to import and query unstructured data using the\n`CrateDBVectorStore`, for example to create a retrieval augmented generation\n(RAG) pipeline.\n\nRetrieval-Augmented Generation (RAG) combines a retrieval system, which fetches\nrelevant documents, with a generative model, allowing it to incorporate external\nknowledge for more accurate and informed responses.\n\n- [Example: Basic vector search]\n- [Example: Basic RAG]\n- [Example: Advanced RAG with use case]\n\n### Document Loader\n\nThis notebook demonstrates how to load documents from a CrateDB database, using\nLangChain's `SQLDatabase` and `CrateDBLoader` interfaces, based on SQLAlchemy.\n\n- [Example: Load data from database table]\n\n### Chat History\n\nThe chat message history adapter helps to store and manage chat message history\nin a CrateDB table, for supporting conversational memory.\n\n- [Example: Chat message history]\n\n\n## Project Information\n\n### Acknowledgements\nKudos to the authors of all the many software components this library is\ninheriting from and building upon, most notably the [langchain-postgres]\npackage, and [langchain] itself.\n\n### Contributing\nThe `langchain-cratedb` package is an open source project, and is\n[managed on GitHub]. The project is still in its infancy, and\nwe appreciate contributions of any kind.\n\n### License\nThe project uses the MIT license, like the langchain-postgres project\nit is deriving from.\n\n\n[CrateDB]: https://cratedb.com/database\n[CrateDB Cloud]: https://cratedb.com/database/cloud\n[CrateDB Cloud Console]: https://console.cratedb.cloud/\n[CrateDB Installation]: https://cratedb.com/docs/guide/install/\n[CrateDB LangChain examples]: https://github.com/crate/cratedb-examples/tree/main/topic/machine-learning/llm-langchain\n[CrateDB Self-Managed]: https://cratedb.com/database/self-managed\n[CrateDBVectorStore]: https://github.com/crate/langchain-cratedb/blob/cratedb/docs/vectorstores.ipynb\n[crate]: https://pypi.org/project/crate/\n[Example: Advanced RAG with use case]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/cratedb_rag_customer_support_langchain.ipynb\n[Example: Chat message history]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/conversational_memory.ipynb\n[Example: Basic RAG]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/cratedb_rag_customer_support.ipynb\n[Example: Basic vector search]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/vector_search.ipynb\n[Example: Load data from database table]: https://github.com/crate/cratedb-examples/blob/main/topic/machine-learning/llm-langchain/document_loader.ipynb\n[LangChain]: https://www.langchain.com/\n[langchain]: https://github.com/langchain-ai/langchain\n[langchain-postgres]: https://github.com/langchain-ai/langchain-postgres\n[Llama]: https://www.llama.com/\n[OpenAI]: https://openai.com/\n[Using LangChain with CrateDB]: https://cratedb.com/docs/guide/integrate/langchain/\n\n[Changelog]: https://github.com/crate/langchain-cratedb/blob/cratedb/CHANGES.md\n[Community Forum]: https://community.cratedb.com/\n[Documentation]: https://cratedb.com/docs/guide/integrate/langchain/\n[Issues]: https://github.com/crate/langchain-cratedb/issues\n[License]: https://github.com/crate/langchain-cratedb/blob/cratedb/LICENSE\n[managed on GitHub]: https://github.com/crate/langchain-cratedb\n[PyPI]: https://pypi.org/project/langchain-cratedb/\n[Source code]: https://github.com/crate/langchain-cratedb\n\n[badge-bluesky]: https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff&label=Follow%20%40CrateDB\n[badge-ci]: https://github.com/crate/langchain-cratedb/actions/workflows/ci.yml/badge.svg\n[badge-downloads-per-month]: https://pepy.tech/badge/langchain-cratedb/month\n[badge-license]: https://img.shields.io/github/license/crate/langchain-cratedb.svg\n[badge-package-version]: https://img.shields.io/pypi/v/langchain-cratedb.svg\n[badge-python-versions]: https://img.shields.io/pypi/pyversions/langchain-cratedb.svg\n[badge-release-notes]: https://img.shields.io/github/release/crate/langchain-cratedb?label=Release+Notes\n[badge-status]: https://img.shields.io/pypi/status/langchain-cratedb.svg\n[project-bluesky]: https://bsky.app/search?q=cratedb\n[project-ci]: https://github.com/crate/langchain-cratedb/actions/workflows/ci.yml\n[project-downloads]: https://pepy.tech/project/langchain-cratedb/\n[project-license]: https://github.com/crate/langchain-cratedb/blob/cratedb/LICENSE\n[project-pypi]: https://pypi.org/project/langchain-cratedb\n[project-release-notes]: https://github.com/crate/langchain-cratedb/releases\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Integration package connecting CrateDB and LangChain",
"version": "0.0.0",
"project_urls": {
"Homepage": "https://github.com/crate/langchain-cratedb",
"Release Notes": "https://github.com/crate/langchain-cratedb/releases",
"Repository": "https://github.com/crate/langchain-cratedb",
"Source Code": "https://github.com/crate/langchain-cratedb"
},
"split_keywords": [
"cratedb",
" embeddings",
" embedding-vectors",
" langchain",
" llm",
" vdbms",
" vector database",
" vector store"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89c3c5d3143aafd415ce9986a0a9dea0d0d04654e769683719274f9859d37b9c",
"md5": "0c0d06e93534be119a05d9ed37071387",
"sha256": "d3e74d4aadac3f3f8aff4dc6b052a6b16639fcaa1c4531c01cb4c94b15f6078e"
},
"downloads": -1,
"filename": "langchain_cratedb-0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c0d06e93534be119a05d9ed37071387",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 20716,
"upload_time": "2024-12-16T00:55:19",
"upload_time_iso_8601": "2024-12-16T00:55:19.993391Z",
"url": "https://files.pythonhosted.org/packages/89/c3/c5d3143aafd415ce9986a0a9dea0d0d04654e769683719274f9859d37b9c/langchain_cratedb-0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "01577de55c82df99f01c309450aa241e1fd731b3946577b46dac04611e2c1cc9",
"md5": "7671b8c7f26339cbb6cd02d080c70176",
"sha256": "c7eae0d0ad306ebf23f9ec84ecb9ab8e40ea9886c2e0d154fc03ba31c230766c"
},
"downloads": -1,
"filename": "langchain_cratedb-0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "7671b8c7f26339cbb6cd02d080c70176",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 19183,
"upload_time": "2024-12-16T00:55:22",
"upload_time_iso_8601": "2024-12-16T00:55:22.482296Z",
"url": "https://files.pythonhosted.org/packages/01/57/7de55c82df99f01c309450aa241e1fd731b3946577b46dac04611e2c1cc9/langchain_cratedb-0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 00:55:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crate",
"github_project": "langchain-cratedb",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "langchain-cratedb"
}