Skip to main content

taguru (Python SDK)

Official Python client SDK for the Taguru long-term semantic memory server. The TypeScript SDK (taguru on npm) exposes the identical surface — method names differ only by casing convention (search_passages ↔ searchPassages); data fields are the wire's own snake_case in both.

pip install taguru
from taguru import Taguru

client = Taguru()  # defaults: $TAGURU_URL / $TAGURU_API_TOKEN, else http://127.0.0.1:8248
client.contexts.create("sake", description="青嶺酒造という架空の酒蔵の知識")

ctx = client.context("sake")
ctx.add_associations([
    {"subject": "青嶺酒造", "label": "代表銘柄", "object": "青嶺", "weight": 1.0, "source": "docs/aomine.md"},
])
ctx.store_passages({"docs/aomine.md": "青嶺酒造は1907年創業。代表銘柄は「青嶺」。"})

result = ctx.retrieve("青嶺酒造")           # resolve → describe → activate → citations
hits = ctx.search_passages("1907年に創業した")  # text lane (phrase as an answer)
package = ctx.assemble_evidence("青嶺酒造", budget={"max_items": 10})  # server-side budgeted package

Prefer one add_associations call per document. Above the 10,000-association request limit, add_associations_batched auto-chunks it; for corpus-scale ingestion, use POST /import or taguru import. Each call pays for a full durable write.

AsyncTaguru is the same surface with async/await. The behavioral contract is the server's own protocol document — read it from the deployment you target: client.protocol() (GET /protocol).

Tracing

retrieve() composes a client-side loop the same way the server's own retrieve MCP tool does — resolve → describe → query → activate → citations → passage fallback. Optionally trace it as one OpenTelemetry span tree, taguru.retrieve with a child span per phase, joined to the server's own request span through injected traceparent/tracestate headers:

pip install "taguru[otel]"  # pulls in opentelemetry-api; core install stays dependency-free otherwise
pip install opentelemetry-sdk  # an actual TracerProvider — pick whichever OTel SDK/exporter you use instead if not this one
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry import trace

trace.set_tracer_provider(TracerProvider())  # wire up whichever exporter you use — the SDK just emits spans

With no TracerProvider configured (or opentelemetry-api not installed at all), every tracing call in the SDK is a silent no-op — nothing about retrieve()'s behavior or return value changes either way. See Tracing for the full span tree, the attribute/event vocabulary (shared with the TypeScript SDK via sdk/spec/tracing.yaml), and the privacy rules (spans carry counts, flags, and closed reason codes — never cue text, labels, or passage content).

See the repository's sdk/ directory for the full documentation, the LangChain integration (langchain-taguru), and the cross-language surface spec.

Metadata

Release files for taguru 0.9.7

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

Source distribution (sdist)

Source distribution for taguru 0.9.7
File Size Uploaded Provenance Actions
taguru-0.9.7.tar.gz 191.3 kB Without provenance Details for taguru-0.9.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for taguru 0.9.7
File Interpreter ABI Platform Actions
taguru-0.9.7-py3-none-any.whl Python 3 none any Details for taguru-0.9.7-py3-none-any.whl

Total release size: 261.1 kB

Release files / taguru-0.9.7.tar.gz

Download URL taguru-0.9.7.tar.gz
Size 191.3 kB
Tags Source
SHA-256 checksum
How to use checksums
df60bf5808659c07c82f91be0a1955d4fa80a007fc555cb64bd16b6c849ad1fb
BLAKE2b-256 checksum
How to use checksums
482ab1b80c53b9c88f9dbf1943aa8685bd77474eb4c41fe07d06d014e0f7654a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / taguru-0.9.7-py3-none-any.whl

Download URL taguru-0.9.7-py3-none-any.whl
Size 69.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9858b3d01e62edd7b6150b6f38432810ff0fb8495691408d04f4cd5bece1641
BLAKE2b-256 checksum
How to use checksums
2b66c03a68dce5f976277dc3038bc8409b2553fd669fa35bc43f79f09811b3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for taguru 0.9.7

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.

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