Skip to main content

fishmem

Official Python SDK for FishMem Cloud, self-hosted FishMem, and FishMem Desktop.

pip install fishmem
from fishmem import FishMem

with FishMem(api_key="fm_...") as fishmem:
    fishmem.memories.add_and_wait(
        {
            "content": "The user prefers concise answers.",
            "user_id": "alex",
        },
        idempotency_key="alex-answer-style-v1",
    )
    results = fishmem.memories.search(
        {"query": "How should I answer Alex?", "user_id": "alex"}
    )

Use AsyncFishMem in async applications. Neither client applies hidden automatic retries; mutation methods accept an explicit idempotency_key. Both clients expose health.get() for authenticated project readiness and durable backlog status.

Structural scope entities are available on sync, async, and Desktop clients:

for entity in fishmem.entities.list_all(entity_type="user"):
    print(entity["id"], entity["total_memories"])

fishmem.entities.delete(
    "user", "alex", idempotency_key="delete-user-alex-v1"
)

They are derived from active canonical memories and are distinct from named entities in the memory graph.

The HTTP and Desktop clients share audited memory feedback:

fishmem.memories.set_feedback(
    "mem_123",
    {"rating": "negative", "reason": "Out of date"},
    idempotency_key="feedback-mem-123-v1",
)
current = fishmem.memories.get_feedback("mem_123")

Inferred writes are asynchronous. memories.add_async(...) returns a durable Event receipt immediately, events.wait(...) polls it, and memories.add_and_wait(...) returns the terminal refined results. An already-distilled infer=False add remains synchronous. Both sync and async clients expose events.list, events.get, and events.wait.

Hosted/self-hosted HTTP clients can inspect the opt-in governed shadow projection without changing state or recall:

view = fishmem.beliefs.get(
    {
        "user_id": "alex",
        "subject": "Alex",
        "attribute": "answer_style",
        "view": "audit",
    }
)

The async form is await fishmem.beliefs.get(...). This resource is not part of the local Desktop CLI surface.

memories.batch_update(...) and memories.batch_delete(...) queue up to 1,000 selected mutations and return an operation with ordered per-item results. Both require idempotency_key; the same methods work through FishMemDesktop in one local CLI call.

Long-form text uses the separate source-RAG resource:

from pathlib import Path

uploaded = fishmem.documents.upload(
    Path("./handbook.pdf"),
    {
        "source_key": "handbook/product.pdf",
        "user_id": "alex",
    },
    idempotency_key="handbook-pdf-v1",
)

completed = fishmem.operations.wait(
    uploaded["operation"]["id"],
    interval=1.0,
    timeout=600.0,
)

source = fishmem.documents.ingest(
    {
        "source_key": "handbook/deployments.md",
        "content": "# Deployments\n\nProduction deploys require...",
        "mime_type": "text/markdown",
        "user_id": "alex",
    },
    idempotency_key="handbook-deployments-v1",
)
evidence = fishmem.documents.search(
    {"query": "What is required before deployment?", "user_id": "alex"}
)
original = fishmem.documents.content(source["document"]["id"])

The synchronous and asynchronous clients both expose direct text ingest, asynchronous file upload, search, list/list-all, get, content, and permanent source-family deletion. HTTP file upload accepts supported PDF, Office, EPUB, email, image, and text files up to 25 MB and 300 extracted pages. It retains the raw file and lossless extraction structure, then indexes extracted Markdown. Use create_upload, get_upload, and complete_upload when you need manual lifecycle control.

For the local Desktop process:

from fishmem import FishMemDesktop

desktop = FishMemDesktop()  # invokes the machine-oriented fishmem CLI
desktop.memories.add(
    {
        "content": "Use the canonical deployment pipeline.",
        "infer": False,
    },
    idempotency_key="deployment-pipeline-v1",
)
source = desktop.documents.ingest(
    {
        "source_key": "handbook/deployments.md",
        "content": "# Deployments\n\nProduction deploys require...",
        "mime_type": "text/markdown",
    },
    idempotency_key="local-handbook-deployments-v1",
)
uploaded = desktop.documents.upload(
    Path("./deployments.md"),
    {"source_key": "handbook/deployments.md", "agent_id": "codex"},
    idempotency_key="local-handbook-file-v1",
)
evidence = desktop.documents.search(
    {"query": "What is required before deployment?"}
)
original = desktop.documents.content(source["document"]["id"])

for entity in desktop.entities.list_all(entity_type="user"):
    print(entity["id"], entity["total_memories"])

FishMem Desktop accepts already-distilled records and always stores them with infer=false. It never invokes a remote LLM or embedding provider. desktop.documents exposes the same ingest, upload, search, list/list-all, get, content, and delete operations for textual sources. Upload validates and decodes at most 1 MB of UTF-8 locally; it does not run Docling/OCR or call a remote embedding or file-processing provider. Payloads travel over stdin, not the process argument list.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fishmem-0.2.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fishmem-0.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file fishmem-0.2.0.tar.gz.

File metadata

  • Download URL: fishmem-0.2.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fishmem-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6483fa67b55dcd96afb853f51432aa7f47f741a51a4e487211be1e2f196aafad
MD5 0c746bbf8694b6f154e9b2190e158399
BLAKE2b-256 1ec94b8385a6a7c402858912c444365b116fcd88d113acfd025333d0cabfc61c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fishmem-0.2.0.tar.gz:

Publisher: publish-python.yml on fishmem-labs/fishmem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fishmem-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fishmem-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fishmem-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7cdded0ae78e7aec6d52f17a4a4ede0a952d1c256fa9a398b2d9abe99203d75
MD5 84e7efba53fcc8469f12c55fc0ffe7ad
BLAKE2b-256 d048cd3df970ae5a1e7b2690ec66a7448762bc0b21866d0c77c893c6f7d745b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fishmem-0.2.0-py3-none-any.whl:

Publisher: publish-python.yml on fishmem-labs/fishmem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

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