Skip to main content

DeepEval AI framework plugin for GoodMem, a retrieval-augmented generation (RAG) memory service.

Project description

deepeval-goodmem

GoodMem integration for DeepEval.

GoodMem gives AI agents retrieval-augmented generation (RAG) memory. Store documents in a space and GoodMem chunks, embeds, and indexes them so your agent can pull back the most relevant passages on any question.

This package exposes the GoodMem API as a set of DeepEval-flavoured operation classes. Each operation has a run(...) method that returns a JSON string, making them callable from any evaluation script, test harness, or scoring pipeline.

Installation

pip install deepeval-goodmem

For local development:

pip install -e ".[dev]"

Quickstart

import json
import os

os.environ["GOODMEM_BASE_URL"] = "https://localhost:8080"
os.environ["GOODMEM_API_KEY"] = "gm_xxxxxxxxxxxxxxxxxxxxxxxx"
os.environ["GOODMEM_VERIFY_SSL"] = "false"  # self-signed local server

from deepeval_goodmem import (
    GoodMemCreateMemory,
    GoodMemCreateSpace,
    GoodMemListEmbedders,
    GoodMemRetrieveMemories,
)

embedders = json.loads(GoodMemListEmbedders().run())
embedder_id = embedders["embedders"][0]["embedderId"]

space = json.loads(
    GoodMemCreateSpace().run(name="quickstart", embedder_id=embedder_id)
)
space_id = space["spaceId"]

GoodMemCreateMemory().run(
    space_id=space_id,
    text_content="The capital of France is Paris.",
)

results = json.loads(
    GoodMemRetrieveMemories().run(
        query="What is the capital of France?",
        space_ids=space_id,
        max_results=3,
    )
)
print(results)

Every operation's run(...) returns a JSON string. On success the parsed object includes "success": true and operation-specific fields. On failure it includes "success": false and an "error" field.

The local GoodMem dev server ships with TLS even on localhost. Set GOODMEM_VERIFY_SSL=false to accept the self-signed certificate during development; production deployments behind a trusted certificate should leave it at the default of true.

Available operations

Operation Description
GoodMemListEmbedders List embedder models available on the server
GoodMemListSpaces List all spaces accessible to the API key
GoodMemGetSpace Fetch a space by ID
GoodMemCreateSpace Create a space (idempotent by name)
GoodMemUpdateSpace Update a space's name, labels, or public-read flag
GoodMemDeleteSpace Delete a space and all of its memories
GoodMemCreateMemory Store text or a file as a memory
GoodMemListMemories List memories in a space, with pagination and filters
GoodMemRetrieveMemories Semantic retrieval across one or more spaces
GoodMemGetMemory Fetch a memory by ID, with optional content
GoodMemDeleteMemory Delete a memory

Retrieval options

GoodMemRetrieveMemories accepts the following parameters in addition to query, space_ids, and max_results:

Parameter Type Description
metadata_filter str SQL-style JSONPath filter applied server-side to every space key. Example: CAST(val('$.category') AS TEXT) = 'feat'
wait_for_indexing bool Poll for results when none come back on the first call (default True)
max_wait_seconds float Polling budget (default 60.0)
poll_interval float Seconds between polls (default 5.0)
reranker_id str Reranker model to refine result ordering
llm_id str LLM that generates a contextual abstract reply
relevance_threshold float Minimum score (0-1) for inclusion
llm_temperature float Creativity (0-2) for the LLM post-processor
chronological_resort bool Reorder results by creation time

Environment variables

Variable Description
GOODMEM_BASE_URL Base URL of the GoodMem API server
GOODMEM_API_KEY API key sent as X-API-Key
GOODMEM_VERIFY_SSL Set to false to skip TLS verification (default true)

When the env vars are set, every operation constructor can be called with no arguments.

End-to-end example

examples/example_usage.py walks through three scenarios: persistent project context, a scribe and analyst pipeline, and metadata-driven retrieval. The answering step uses OpenAI; install with pip install deepeval-goodmem[examples] and set OPENAI_API_KEY before running.

python examples/example_usage.py

License

Apache License 2.0. See LICENSE.

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

deepeval_goodmem-0.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

deepeval_goodmem-0.1.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepeval_goodmem-0.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for deepeval_goodmem-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec6bdd7e2729ca6ff9eaf0af31739cfad21c63169f2572d5513d935ffb5dee01
MD5 7b8ac6256485b2eba357b0c2358164b3
BLAKE2b-256 d552f346721a4cdd4e0803ee93ff0bc2afd7fa20b950f45063f49af7bc75e4d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepeval_goodmem-0.1.0.tar.gz:

Publisher: publish.yml on PAIR-Systems-Inc/goodmem_deepeval

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

File details

Details for the file deepeval_goodmem-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepeval_goodmem-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb966a9bdacb6f628ca76358006334879aedbb7a36a8459b57d53e44be98107c
MD5 bff16a3afb704ff6507be84a88a13824
BLAKE2b-256 deb79b20e9413d4a3124637189ebbe80fdd17995ace89f6eacd39ed8c28e75fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepeval_goodmem-0.1.0-py3-none-any.whl:

Publisher: publish.yml on PAIR-Systems-Inc/goodmem_deepeval

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

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