neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
LangChain abstractions backed by CockroachDB
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Build LLM applications with CockroachDB's distributed SQL database and native vector search capabilities. This integration provides:
VECTOR typepip install langchain-cockroachdb
import asyncio
from langchain_cockroachdb import AsyncCockroachDBVectorStore, CockroachDBEngine
from langchain_openai import OpenAIEmbeddings
async def main():
# Initialize
engine = CockroachDBEngine.from_connection_string(
"cockroachdb://user:pass@host:26257/db"
)
await engine.ainit_vectorstore_table(
table_name="documents",
vector_dimension=1536,
)
vectorstore = AsyncCockroachDBVectorStore(
engine=engine,
embeddings=OpenAIEmbeddings(),
collection_name="documents",
)
# Add documents
await vectorstore.aadd_texts([
"CockroachDB is a distributed SQL database",
"LangChain makes building LLM apps easy",
])
# Search
results = await vectorstore.asimilarity_search(
"Tell me about databases",
k=2
)
for doc in results:
print(doc.page_content)
await engine.aclose()
asyncio.run(main())
CockroachDBStore gives LangGraph agents memory that every thread can read, with semantic search and expiry:
from langchain_cockroachdb import CockroachDBStore
from langchain_openai import OpenAIEmbeddings
with CockroachDBStore.from_conn_string(
"cockroachdb://user:pass@host:26257/db",
pool_config={"max_size": 10},
index={"dims": 1536, "embed": OpenAIEmbeddings(model="text-embedding-3-small")},
ttl={"default_ttl": 60 * 24 * 30}, # minutes
) as store:
store.setup()
store.put(("user", "alice", "memories"), "seat", {"text": "Prefers window seats"})
results = store.search(("user", "alice"), query="Where does Alice like to sit?")
# Pass store=store to create_agent, StateGraph.compile or create_deep_agent
See the Long-Term Memory guide.
VECTOR type support with C-SPANN indexes$and, $or, $gt, $in, etc.)CockroachDBSaver (sync) and AsyncCockroachDBSavercompile(checkpointer=...) interfaceCockroachDBStore (sync) and AsyncCockroachDBStore, with the API of LangGraph's PostgresStoredelete_namespace deletes a user's memories in one transactionRetryPolicy with exponential backoff, jitter and optional hang guardsLangChain Official Integration Docs:
Getting Started:
Guides:
quickstart.py - Get started in 5 minutessync_usage.py - Synchronous APIvector_indexes.py - Index optimizationhybrid_search.py - FTS + vector searchmetadata_filtering.py - Advanced querieschat_history.py - Persistent conversationscheckpointer.py - LangGraph checkpointerlong_term_memory.py - LangGraph long-term memory storemulti_tenancy.py - Namespace-based multi-tenancyretry_configuration.py - Configuration patterns# Clone repository
git clone https://github.com/cockroachdb/langchain-cockroachdb.git
cd langchain-cockroachdb
# Install dependencies
pip install -e ".[dev]"
# Start CockroachDB
docker-compose up -d
# Run tests
make test
# Install docs dependencies
pip install -e ".[docs]"
# Serve documentation locally
mkdocs serve
# Open http://127.0.0.1:8000
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
VECTOR type and C-SPANN indexesApache License 2.0 - see LICENSE for details.
Built for the CockroachDB and LangChain communities.