GoodMemGoodMem
IntegrationsAgent Frameworks

Microsoft NLWeb

Expose the GoodMem RAG API as NLWeb-style operation classes for any NLWeb handler or tool dispatcher.

Stable· Python

Overview

GoodMem is a memory layer for AI agents that handles embedding, vector search, reranking, and LLM-powered answering server-side. The NLWeb integration wraps those operations — creating spaces, storing memories, and semantic retrieval with optional reranking and LLM summaries — as NLWeb-style operation classes. Each operation exposes a run(...) method that returns a JSON string, so the classes can be called from any NLWeb handler or tool dispatcher.

Installation

pip install nlweb-goodmem

The pip package is nlweb-goodmem; the import name is nlweb_goodmem.

Configuration

VariableDescription
GOODMEM_BASE_URLBase URL of the GoodMem API server, e.g. https://your-goodmem-server.example.com.
GOODMEM_API_KEYAPI key sent as the X-API-Key header to authenticate requests.
GOODMEM_VERIFY_SSLSet to false to skip TLS verification for self-signed dev certs (default: true).

When the environment variables are set, every operation constructor can be called with no arguments.

Quick start

import json
import os

os.environ["GOODMEM_BASE_URL"] = "https://your-goodmem-server.example.com"
os.environ["GOODMEM_API_KEY"] = "gm_xxxxxxxxxxxxxxxxxxxxxxxx"
os.environ["GOODMEM_VERIFY_SSL"] = "false"  # self-signed local server

from nlweb_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)

Local development. The example above uses a TLS-verified production URL. If you are running GoodMem locally with a self-signed certificate, use https://localhost:8080 and disable TLS verification with the client's verify-SSL option (see the Configuration table above). Keep TLS verification enabled for any deployed server.

Retrieval post-processing

GoodMem's retrieval call accepts these optional post-processing parameters (each framework exposes them under its own naming convention):

ParameterRangeDescription
reranker_idUUIDReranker model that reorders matched chunks by relevance.
llm_idUUIDLLM that generates a contextual answer (abstractReply) alongside the chunks.
relevance_threshold0–1Minimum relevance score for a result to be included.
llm_temperature0–2Sampling temperature for the LLM post-processor.
max_resultsintegerMaximum number of results to return.
chronological_resortbooleanRe-sort the final results by creation time instead of relevance.

Learn more

The full README, examples, and API reference are available on the PyPI package page.