Skip to main content

langchain-bilinc

LangChain integration for Bilinc, shared and versioned memory for AI agents.

  • BilincRemember: a tool that saves a fact, decision or preference to Bilinc (commit).
  • BilincRecall: a tool that searches Bilinc memory in plain language (recall).
  • BilincRetriever: a retriever that returns recalled memories as LangChain Documents.

All three wrap the official bilinc Python SDK.

Source: https://github.com/ReARCLabs/bilinc-langchain

Install

pip install -U langchain-bilinc

Credentials

Set BILINC_API_KEY, or pass api_key=. If neither is set, the SDK uses the key saved by bilinc login. Get a key at bilinc.space/signup.

export BILINC_API_KEY="..."

Tools

from langchain_bilinc import BilincRecall, BilincRemember

remember = BilincRemember(key_prefix="support-agent")
remember.invoke({"key": "user.timezone", "value": "Europe/Istanbul"})
# {"saved": True, "key": "support-agent.user.timezone", "entry_version": "..."}

recall = BilincRecall(limit=5)
recall.invoke({"query": "what timezone is the user in?"})
# [{"key": "support-agent.user.timezone", "value": "Europe/Istanbul", "score": ..., ...}]

Give both to an agent so it can save and look up memory across sessions:

from langchain.agents import create_agent
from langchain_bilinc import BilincRecall, BilincRemember

agent = create_agent(
    model="anthropic:claude-sonnet-5-5",
    tools=[BilincRecall(), BilincRemember(key_prefix="my-agent")],
    system_prompt="Recall memory before acting on earlier decisions. Save only durable facts.",
)

BilincRemember details:

  • Writing to an existing key replaces its value; Bilinc keeps the earlier value in that memory's history.
  • Without a key, the tool derives a stable key from the value, so saving the same value twice writes the same key.
  • Options: key_prefix, default_memory_type (semantic), default_importance (1.0), source ("langchain"), session_id, metadata.
  • session_id is trimmed, and a blank one is not sent. One longer than 256 characters (Bilinc's limit) is sent as its hash.

BilincRecall options: limit (5), profile (fast, balanced, verified, deep; higher profiles depend on your plan), memory_types.

Retriever

from langchain_bilinc import BilincRetriever

retriever = BilincRetriever(k=5, profile="balanced")
docs = retriever.invoke("what did we decide about the release?")
for doc in docs:
    print(doc.metadata["key"], doc.page_content)

page_content is the stored value; JSON values are serialized. metadata holds key, memory_type, importance, score, source, entry_version and updated_at when the service returns them.

Bilinc's limits are applied before the call:

  • k (on the retriever or per call) is capped at 100.
  • The query is cut at 4,096 characters.
  • A k of 0 or less, or a blank query, returns no documents without a call (so no credit is used).

A failed recall raises the SDK's own error (bilinc.BilincRateLimitError, bilinc.BilincAuthError, ...), so except bilinc.BilincError catches it.

Errors and costs

Tool errors are raised as ToolException (set handle_tool_error=True to return them to the model). A failed save means nothing was saved. Saves and recalls use Bilinc credits; see pricing.

Development

pip install -e . pytest pytest-asyncio "langchain-tests>=1.1.9,<2"
pytest

The unit tests replace the SDK transport with a fake and never reach the network.

License

MIT for this package. The bilinc SDK it depends on has its own license (BUSL-1.1).

Metadata

Release files for langchain-bilinc 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-bilinc 0.1.0
File Size Uploaded Provenance Actions
langchain_bilinc-0.1.0.tar.gz 10.6 kB Without provenance Details for langchain_bilinc-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 19.8 kB

Release files / langchain_bilinc-0.1.0.tar.gz

Download URL langchain_bilinc-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
004a6574f54852e078be86c1e1511ba61838ee7f38e704b7552a405b3f26f210
BLAKE2b-256 checksum
How to use checksums
7a8d9f5c04ad520b0f0c4c5aabc684cb00e2ccadc327f8618c95d4f5bdfd13a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.7

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

Download URL langchain_bilinc-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abc492837db53c845d56e0745902b6ce6632666bda1c9577857b2b1beb6adc53
BLAKE2b-256 checksum
How to use checksums
738010d0d55a72d56e072d03b0bd161d6f675fa1783f56e94c4232cb64f2ac0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.7

Security for langchain-bilinc 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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 No 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