GoodMemGoodMem
IntegrationsAgent Frameworks

Microsoft Agent Framework

Give Microsoft Agent Framework agents persistent semantic memory through a GoodMem client, context provider, and function tools.

Stable· Python

Overview

GoodMem is a memory layer for AI agents that handles embedding, vector search, reranking, and LLM-powered answering server-side. This integration gives Microsoft Agent Framework agents persistent, semantic long-term memory backed by a GoodMem server. It ships an async REST client (GoodMemClient), a GoodMemContextProvider that retrieves relevant memories before each agent run and stores conversations afterwards, and a create_goodmem_tools factory that exposes function tools so the model itself can manage spaces and memories.

Installation

pip install agent-framework-goodmem

The pip package is agent-framework-goodmem; the import name is agent_framework_goodmem.

Configuration

The GoodMemClient is configured directly via constructor arguments rather than environment variables:

ArgumentDescription
base_urlBase URL of your GoodMem server (no /v1 suffix), e.g. https://your-goodmem-server.example.com.
api_keyAPI key used to authenticate requests.
verify_sslSet to False to skip TLS verification for self-signed dev certs.

The integration test suite also reads GOODMEM_BASE_URL and GOODMEM_API_KEY from the environment.

Quick start

import asyncio
from agent_framework_goodmem import GoodMemClient, create_goodmem_tools

async def main():
    client = GoodMemClient(
        base_url="https://your-goodmem-server.example.com",
        api_key="gm_xxxxxxxxxxxxxxxxxxxxxxxx",
    )

    embedders = await client.list_embedders()
    embedder_id = embedders[0]["embedderId"]

    space = await client.create_space(name="quickstart", embedder_id=embedder_id)
    space_id = space["spaceId"]

    await client.create_memory(
        space_id=space_id,
        text_content="The capital of France is Paris.",
    )

    results = await client.retrieve_memories(
        query="What is the capital of France?",
        space_ids=[space_id],
        max_results=3,
        wait_for_indexing=True,
    )
    print(results)

    await client.close()

asyncio.run(main())

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.