{"id":23057130,"url":"https://github.com/crate/langchain-cratedb","last_synced_at":"2025-04-28T11:16:58.621Z","repository":{"id":267887292,"uuid":"902654648","full_name":"crate/langchain-cratedb","owner":"crate","description":"CrateDB provider for LangChain.","archived":false,"fork":false,"pushed_at":"2025-04-23T14:02:56.000Z","size":230,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-28T11:16:52.601Z","etag":null,"topics":["cratedb","cratedb-client","cratedb-connector","cratedb-driver","cratedb-sdk","embedding-vectors","embeddings","langchain","langchain-openai","langchain-python","llm","openai","vdbms","vector-database","vector-store"],"latest_commit_sha":null,"homepage":"https://cratedb.com/docs/guide/integrate/langchain/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T02:09:02.000Z","updated_at":"2025-04-14T08:15:40.000Z","dependencies_parsed_at":"2025-01-02T18:36:59.603Z","dependency_job_id":"de407133-1da7-4ed7-9ea7-99066339d8cc","html_url":"https://github.com/crate/langchain-cratedb","commit_stats":null,"previous_names":["crate/langchain-cratedb"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Flangchain-cratedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Flangchain-cratedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Flangchain-cratedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crate%2Flangchain-cratedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crate","download_url":"https://codeload.github.com/crate/langchain-cratedb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251302782,"owners_count":21567601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cratedb","cratedb-client","cratedb-connector","cratedb-driver","cratedb-sdk","embedding-vectors","embeddings","langchain","langchain-openai","langchain-python","llm","openai","vdbms","vector-database","vector-store"],"created_at":"2024-12-16T02:10:56.688Z","updated_at":"2025-04-28T11:16:58.596Z","avatar_url":"https://github.com/crate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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» [Documentation]\n| [Changelog]\n| [PyPI]\n| [Issues]\n| [Source code]\n| [License]\n| [CrateDB]\n| [Community Forum]\n\nThe `langchain-cratedb` package implements the [CrateDB provider for LangChain],\ni.e. core LangChain abstractions using [CrateDB] or [CrateDB Cloud].\n\nFeel free to use the abstractions as provided or else modify them / extend them\nas appropriate for your own applications. 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’s 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\nMeta's [Llama] multilingual text-only and text-image models.\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] or start using [CrateDB Cloud],\nsee [CrateDB Installation], or [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.\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### Full Cache\n\nThe standard / full cache avoids invoking the LLM when the supplied\nprompt is exactly the same as one encountered already.\n\n- [Example: CrateDBCache]\n\n### Semantic Cache\n\nThe semantic cache allows users to retrieve cached prompts based on semantic\nsimilarity between the user input and previously cached inputs, also avoiding\nto invoke the LLM when not needed.\n\n- [Example: CrateDBSemanticCache]\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]. We 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 provider for LangChain]: https://python.langchain.com/docs/integrations/providers/cratedb/\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: CrateDBCache]: https://github.com/crate/langchain-cratedb/blob/main/examples/basic/cache.py\n[Example: CrateDBSemanticCache]: https://github.com/crate/langchain-cratedb/blob/main/examples/basic/cache.py\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\u0026logoColor=fff\u0026label=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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrate%2Flangchain-cratedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrate%2Flangchain-cratedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrate%2Flangchain-cratedb/lists"}