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.

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.1.0.tar.gz (21.7 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.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fishmem-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd60320e88e57ade45cb81447546ee09f97cd450bce37aa87622fb7f93cfc0fd
MD5 30a415f648bceba0bb3e0f685d0eeb40
BLAKE2b-256 67a4400804165ecd49050121be1d1783b50edf4c1ae3bca6580276ba52a1c51f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fishmem-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: fishmem-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 125a78886a61aee02a4c03f1f72f23fa263b14310ab0f49fad8cc17701305ae9
MD5 1f3c6a1ae13c9e8c9363a799559324e7
BLAKE2b-256 1515f453f96727f9cdc0ca74825a6280996b06853f590e85ddd7ad7e6512d692

See more details on using hashes here.

Provenance

The following attestation bundles were made for fishmem-0.1.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

0.2.0

2 files

This release

0.1.0 This release

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