Skip to main content

langchain-synapcores

LangChain integration for SynapCores, the AI-native database. SynapCores combines SQL, vector search, a Cypher graph, in-database AutoML and agent memory in one self-hosted engine.

This package provides:

  • SynapCoresVectorStore: a LangChain vector store on an ordinary SynapCores SQL table with a VECTOR(N) column. Your documents stay queryable with SQL, joinable with your business tables, and usable from graph queries and AutoML.
  • SynapCoresEmbeddings: embeddings computed inside SynapCores, next to your data, with no external embedding API or key.

Try SynapCores in the browser: synapcores.com/playground

Installation

pip install -U langchain-synapcores

Run SynapCores locally (free Community Edition):

curl -fsSL https://get.synapcores.com | sh

Docker: synapcores/community. See synapcores.com/download.

Configuration

Argument Environment variable Default
url SYNAPCORES_URL http://127.0.0.1:8080
api_key SYNAPCORES_API_KEY none
username / password SYNAPCORES_USERNAME / SYNAPCORES_PASSWORD none

Vector store

from langchain_core.documents import Document
from langchain_synapcores import SynapCoresEmbeddings, SynapCoresVectorStore

vector_store = SynapCoresVectorStore(
    embedding=SynapCoresEmbeddings(),   # or any LangChain embeddings model
    table_name="support_articles",
)

vector_store.add_documents(
    [
        Document(page_content="Reset your password from the account settings page.", metadata={"topic": "account"}),
        Document(page_content="Invoices are emailed on the first day of each month.", metadata={"topic": "billing", "year": 2026}),
    ],
    ids=["kb-1", "kb-2"],
)

vector_store.similarity_search("I forgot my password", k=1)
vector_store.similarity_search("when is my bill?", k=2, filter={"topic": "billing"})
vector_store.similarity_search_with_score("bill", k=2, filter={"year": {"$gte": 2026}})

Metadata filters

Filter Meaning
{"topic": "billing"} equals
{"year": {"$gte": 2024}} $eq, $ne, $gt, $gte, $lt, $lte
{"topic": {"$in": ["a", "b"]}} $in, $nin
{"$or": [{...}, {...}]} $and, $or
{"source.kind": "pdf"} nested keys with dot paths

Retriever

retriever = vector_store.as_retriever(search_kwargs={"k": 4})
retriever.invoke("how do I get my invoice?")

SQL on the same data

The store is a normal table: id TEXT PRIMARY KEY, content TEXT, metadata TEXT, embedding VECTOR(N). You can query it directly in SynapCores, for example to join retrieved chunks with customer records:

SELECT a.id, a.content, COSINE_SIMILARITY(a.embedding, EMBED('reset password')) AS score
FROM support_articles a
ORDER BY score DESC
LIMIT 5;

Pass database="..." to keep LangChain tables in their own SynapCores database. Use distance="euclidean" for Euclidean ranking (the default is cosine).

Embeddings

from langchain_synapcores import SynapCoresEmbeddings

embeddings = SynapCoresEmbeddings()
embeddings.embed_query("wireless headphones")
embeddings.embed_documents(["first text", "second text"])

Development

pip install -e ".[test]"
pytest tests/unit_tests
# Integration tests (includes the LangChain standard test suite) need a running engine:
SYNAPCORES_URL=http://127.0.0.1:8080 SYNAPCORES_API_KEY=... pytest tests/integration_tests

License

MIT

Metadata

Release files for langchain-synapcores 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-synapcores 0.1.0
File Size Uploaded Provenance Actions
langchain_synapcores-0.1.0.tar.gz 13.6 kB With provenance Details for langchain_synapcores-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-synapcores 0.1.0
File Interpreter ABI Platform Actions
langchain_synapcores-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_synapcores-0.1.0-py3-none-any.whl

Total release size: 26.1 kB

Release files / langchain_synapcores-0.1.0.tar.gz

Download URL langchain_synapcores-0.1.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63f3695dadd89c645e2641e2b04dec831178f6004fd63353edb2824e02f464f9
BLAKE2b-256 checksum
How to use checksums
8cd085989b3d2c92d54f761c31bb5d8e827a46c72dc65a84f9754f43c94e027a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / langchain_synapcores-0.1.0-py3-none-any.whl

Download URL langchain_synapcores-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
112d2fd3209545c7c22ba205bcd3c7e2a822d0f738d29df66a723b9f046929e1
BLAKE2b-256 checksum
How to use checksums
e7a76d87c68c57cd052b890431897056d1434f2f181eca4b0637f7b768e69892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for langchain-synapcores 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_synapcores-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page