Skip to main content

GoodMem's Convenient SDK for Python

Project description

GoodMem Python SDK

An OpenAI-style API for Goodmem with auto-inference of model parameters, streaming retrieval, async support, and auto-pagination. The SDK stays in sync with the server's OpenAPI spec — except for hand-written convenience methods (model registry auto-inference, flat post-processor kwargs, etc.) that wrap the generated layer. Please see ../notes/clients_gen.md for the SDK generation details and ../notes/docs_gen.md for the doc generation details.

Installation

pip install goodmem

Usage

The programmatic way

from goodmem import Goodmem

client = Goodmem(
    base_url="http://localhost:8080",
    api_key="gm_..."
)

embedder = client.embedders.create(
    display_name="OpenAI Embedder",
    model_identifier="text-embedding-3-large",
    api_key="sk-your-openai-key",
)

print(f"Created: {embedder.embedder_id}")

The Skill way

# One-time setup — copy the skill into your Claude Code skills directory
cp -r $(python -c "import goodmem; print(goodmem.__path__[0])")/skills ~/.claude/skills/goodmem

Once installed, Claude Code automatically loads the GoodMem SDK reference when you ask it to create embedders, store memories, run retrieval, etc.

Project structure

clients/v2/
├── python/              # Python SDK (this directory, published to PyPI as "goodmem")
├── _clients_gen/         # Code generation (spec → SDK + MCP)
├── _docs_gen/            # Doc generation (ref pages, skills, sdk2rest)
├── mcp/                 # MCP server (published to npm as @pairsystems/goodmem-mcp)
├── claude/              # Claude Code plugin (git subtree → public repo)
├── vibe/                # Cross-SDK vibe auditing (audit_docs.sh, audit_ref_doc.sh, ...)
├── registries/          # Shared model registries (copied into each SDK)
├── ci/                  # CI infrastructure
├── notes/               # Internal dev notes (clients_gen.md, docs_gen.md)
├── clients_gen.sh        # Full SDK generation pipeline
└── docs_gen.sh           # Full doc generation pipeline

Development commands

# Generation (run from clients/v2/, not python/)
cd ..
./clients_gen.sh                # compile server → IR → Python SDK → MCP → test
./clients_gen.sh -y             # same, but skip server-reset confirmation (unattended/CI)
./docs_gen.sh                   # ref pages + skills + snippets
./docs_gen.sh --sdk2rest        # translate SDK test snippets → REST equivalents

# Publishing (run from python/)
cd python
./publish.sh                   # Publish to PyPI
./publish.sh --test            # Publish to TestPyPI

# Vibe auditing (Claude Code non-interactive)
../vibe/audit_docs.sh          # run all doc audits (ref docs + skill docs)
../vibe/audit_ref_doc.sh       # audit generated MDX ref docs against SDK source
../vibe/audit_skill_doc.sh     # audit generated skill reference (SDK, REST, patterns)

In clients_gen.sh, integration test is only activated when environment variables GOODMEM_BASE_URL and GOODMEM_API_KEY are set.

Warning: Before the integration tests, clients_gen.sh and CI all run goodmem-reset.sh to delete ALL resources on the target server. Never point GOODMEM_BASE_URL at a production server. We have a dedicated test server on Fly.io for this purpose. See ci/README.md for more details.

See notes/clients_gen.md for the full regeneration workflow and notes/docs_gen.md for the doc and auditing pipelines.

Documentation

TODO

  1. Add gemini-embedding-001 to embedder registry once backend adds OPENAI_COMPATIBLE to ProviderType.
  2. Add Anthropic, Google, Cohere, and Mistral LLMs to registry once backend adds matching LLMProviderType values.
  3. Automate model registry updates to add new models as they are released.
  4. Generate SDK to an intermediate representation, then map that to cURL, HTTPie, HTTPX, Go, JavaScript, etc.

Project details


Download files

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

Source Distribution

goodmem-0.1.24.tar.gz (151.9 kB view details)

Uploaded Source

Built Distribution

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

goodmem-0.1.24-py3-none-any.whl (166.2 kB view details)

Uploaded Python 3

File details

Details for the file goodmem-0.1.24.tar.gz.

File metadata

  • Download URL: goodmem-0.1.24.tar.gz
  • Upload date:
  • Size: 151.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for goodmem-0.1.24.tar.gz
Algorithm Hash digest
SHA256 ddfcee4fe5b7f647ceac0bd3cae6a78ee4905877d642342a01da4f17218ac3b9
MD5 6614e7c05595b9f916065ed0aa1f321b
BLAKE2b-256 f7fc1e4dd48d70307257d97f249c6a4d9fede228b9f6f84ee6c6a8662d790b5a

See more details on using hashes here.

File details

Details for the file goodmem-0.1.24-py3-none-any.whl.

File metadata

  • Download URL: goodmem-0.1.24-py3-none-any.whl
  • Upload date:
  • Size: 166.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for goodmem-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 71fc2b553c159e9dbaf4b994a6cfb8171031fe981e607d139e747cd9a8be8946
MD5 5a55320a6fcf63db4fa266a42d249923
BLAKE2b-256 0395751071a458f9d4acdb2ebd1f6a5286ff3a7ac368a15651adf7581ba62251

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page