{"id":43374149,"url":"https://github.com/viragtripathi/langchain-cockroachdb","last_synced_at":"2026-02-02T06:17:21.521Z","repository":{"id":335582497,"uuid":"1146359894","full_name":"viragtripathi/langchain-cockroachdb","owner":"viragtripathi","description":"LangChain integration for CockroachDB with native vector support","archived":false,"fork":false,"pushed_at":"2026-01-31T16:45:45.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T16:49:12.605Z","etag":null,"topics":["cockroach-cloud","cockroachdb","langchain","langchain-cockroachdb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viragtripathi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-31T01:09:20.000Z","updated_at":"2026-01-31T16:45:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/viragtripathi/langchain-cockroachdb","commit_stats":null,"previous_names":["viragtripathi/langchain-cockroachdb"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/viragtripathi/langchain-cockroachdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viragtripathi%2Flangchain-cockroachdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viragtripathi%2Flangchain-cockroachdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viragtripathi%2Flangchain-cockroachdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viragtripathi%2Flangchain-cockroachdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viragtripathi","download_url":"https://codeload.github.com/viragtripathi/langchain-cockroachdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viragtripathi%2Flangchain-cockroachdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29006870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T04:25:24.522Z","status":"ssl_error","status_checked_at":"2026-02-02T04:24:51.069Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cockroach-cloud","cockroachdb","langchain","langchain-cockroachdb"],"created_at":"2026-02-02T06:17:20.119Z","updated_at":"2026-02-02T06:17:21.516Z","avatar_url":"https://github.com/viragtripathi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/viragtripathi/langchain-cockroachdb/main/assets/cockroachdb_logo.svg\" alt=\"🪳\" width=\"25\" height=\"25\" style=\"vertical-align: middle;\"/\u003e langchain-cockroachdb\n\n[![Tests](https://github.com/viragtripathi/langchain-cockroachdb/actions/workflows/test.yml/badge.svg)](https://github.com/viragtripathi/langchain-cockroachdb/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/viragtripathi/langchain-cockroachdb/branch/main/graph/badge.svg)](https://codecov.io/gh/viragtripathi/langchain-cockroachdb)\n[![PyPI version](https://badge.fury.io/py/langchain-cockroachdb.svg)](https://badge.fury.io/py/langchain-cockroachdb)\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)\n[![Downloads](https://static.pepy.tech/badge/langchain-cockroachdb/month)](https://pepy.tech/project/langchain-cockroachdb)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\u003cp\u003e\n  \u003cstrong\u003eLangChain integration for CockroachDB with native vector support\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"https://viragtripathi.github.io/langchain-cockroachdb/\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"https://github.com/viragtripathi/langchain-cockroachdb/tree/main/examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\nBuild LLM applications with **CockroachDB's distributed SQL database** and **native vector search** capabilities. This integration provides:\n\n- 🎯 **Native Vector Support** - CockroachDB's `VECTOR` type\n- 🚀 **C-SPANN Indexes** - Distributed vector indexes optimized for scale\n- 🔄 **Automatic Retries** - Handles serialization errors transparently\n- ⚡ **Async \u0026 Sync APIs** - Choose based on your use case\n- 🏗️ **Distributed by Design** - Built for CockroachDB's architecture\n\n## Quick Start\n\n### Installation\n\n```bash\npip install langchain-cockroachdb\n```\n\n### Basic Usage\n\n```python\nimport asyncio\nfrom langchain_cockroachdb import AsyncCockroachDBVectorStore, CockroachDBEngine\nfrom langchain_openai import OpenAIEmbeddings\n\nasync def main():\n    # Initialize\n    engine = CockroachDBEngine.from_connection_string(\n        \"cockroachdb://user:pass@host:26257/db\"\n    )\n    \n    await engine.ainit_vectorstore_table(\n        table_name=\"documents\",\n        vector_dimension=1536,\n    )\n    \n    vectorstore = AsyncCockroachDBVectorStore(\n        engine=engine,\n        embeddings=OpenAIEmbeddings(),\n        collection_name=\"documents\",\n    )\n    \n    # Add documents\n    await vectorstore.aadd_texts([\n        \"CockroachDB is a distributed SQL database\",\n        \"LangChain makes building LLM apps easy\",\n    ])\n    \n    # Search\n    results = await vectorstore.asimilarity_search(\n        \"Tell me about databases\",\n        k=2\n    )\n    \n    for doc in results:\n        print(doc.page_content)\n    \n    await engine.aclose()\n\nasyncio.run(main())\n```\n\n## Features\n\n### Vector Store\n- Native `VECTOR` type support with C-SPANN indexes\n- Advanced metadata filtering (`$and`, `$or`, `$gt`, `$in`, etc.)\n- Hybrid search (full-text + vector similarity)\n- Multi-tenant index support with prefix columns\n\n### Reliability\n- Automatic retry logic with exponential backoff\n- Connection pooling with health checks\n- Configurable for different workloads\n- Built for SERIALIZABLE isolation\n\n### Developer Experience\n- Async-first design for high concurrency\n- Sync wrapper for simple scripts\n- Type-safe with full type hints\n- Comprehensive test suite (92 tests)\n\n## Documentation\n\n**📚 [Complete Documentation](https://viragtripathi.github.io/langchain-cockroachdb/)**\n\n**Getting Started:**\n- [Installation](https://viragtripathi.github.io/langchain-cockroachdb/getting-started/installation/)\n- [Quick Start](https://viragtripathi.github.io/langchain-cockroachdb/getting-started/quick-start/)\n- [Configuration](https://viragtripathi.github.io/langchain-cockroachdb/getting-started/configuration/)\n\n**Guides:**\n- [Vector Store](https://viragtripathi.github.io/langchain-cockroachdb/guides/vector-store/)\n- [Vector Indexes](https://viragtripathi.github.io/langchain-cockroachdb/guides/vector-indexes/)\n- [Hybrid Search](https://viragtripathi.github.io/langchain-cockroachdb/guides/hybrid-search/)\n- [Chat History](https://viragtripathi.github.io/langchain-cockroachdb/guides/chat-history/)\n- [Async vs Sync](https://viragtripathi.github.io/langchain-cockroachdb/guides/async-vs-sync/)\n\n## Examples\n\n**🔧 [Working Examples](https://github.com/viragtripathi/langchain-cockroachdb/tree/main/examples)**\n\n- [`quickstart.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/quickstart.py) - Get started in 5 minutes\n- [`sync_usage.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/sync_usage.py) - Synchronous API\n- [`vector_indexes.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/vector_indexes.py) - Index optimization\n- [`hybrid_search.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/hybrid_search.py) - FTS + vector search\n- [`metadata_filtering.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/metadata_filtering.py) - Advanced queries\n- [`chat_history.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/chat_history.py) - Persistent conversations\n- [`retry_configuration.py`](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/examples/retry_configuration.py) - Configuration patterns\n\n## Development\n\n### Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/viragtripathi/langchain-cockroachdb.git\ncd langchain-cockroachdb\n\n# Install dependencies\npip install -e \".[dev]\"\n\n# Start CockroachDB\ndocker-compose up -d\n\n# Run tests\nmake test\n```\n\n### Documentation\n\n```bash\n# Install docs dependencies\npip install -e \".[docs]\"\n\n# Serve documentation locally\nmkdocs serve\n\n# Open http://127.0.0.1:8000\n```\n\n### Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/CONTRIBUTING.md) for guidelines.\n\n## Why CockroachDB?\n\n- **Distributed SQL** - Scale horizontally across regions\n- **Native Vector Support** - First-class `VECTOR` type and C-SPANN indexes  \n- **Strong Consistency** - SERIALIZABLE isolation by default\n- **Cloud Native** - Deploy anywhere (IBM, AWS, GCP, Azure, on-prem)\n- **PostgreSQL Compatible** - Familiar SQL with distributed superpowers\n\n## License\n\nApache License 2.0 - see [LICENSE](https://github.com/viragtripathi/langchain-cockroachdb/blob/main/LICENSE) for details.\n\n## Acknowledgments\n\nBuilt for the CockroachDB and LangChain communities.\n\n- [CockroachDB](https://www.cockroachlabs.com/) - Distributed SQL database\n- [LangChain](https://github.com/langchain-ai/langchain) - LLM application framework\n\n## Links\n\n- [GitHub Repository](https://github.com/viragtripathi/langchain-cockroachdb)\n- [PyPI Package](https://pypi.org/project/langchain-cockroachdb/)\n- [CockroachDB Documentation](https://www.cockroachlabs.com/docs/)\n- [LangChain Documentation](https://python.langchain.com/)\n- [Report Issues](https://github.com/viragtripathi/langchain-cockroachdb/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviragtripathi%2Flangchain-cockroachdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviragtripathi%2Flangchain-cockroachdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviragtripathi%2Flangchain-cockroachdb/lists"}