GoodMemGoodMem
IntegrationsAgent Frameworks

Firebase Genkit

Expose GoodMem's RAG memory as Genkit tools under the goodmem/ namespace for any Genkit agent or flow.

Stable· JavaScript/TypeScript

Overview

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. The Genkit plugin exposes the GoodMem API as 11 tools under the goodmem/ namespace — creating spaces, storing memories, and semantic retrieval with optional reranking and LLM summaries — callable from any Genkit agent or flow. The canonical source is the standalone genkitx-goodmem package; the upstream Genkit PR is only a proposal.

Installation

npm install genkitx-goodmem
# or
pnpm add genkitx-goodmem
# or
yarn add genkitx-goodmem

genkit is a peer dependency. Install it too if you do not already have it:

npm install genkit

Configuration

VariableDescription
GOODMEM_BASE_URLBase URL of your GoodMem server, e.g. https://your-goodmem-server.example.com.
GOODMEM_API_KEYAPI key sent as the X-API-Key header.
NODE_TLS_REJECT_UNAUTHORIZEDSet to 0 for local dev with a self-signed certificate. Node's fetch reads it directly.

The goodmem() plugin also accepts baseUrl and apiKey arguments directly if you prefer to configure them in code instead of the environment.

Quick start

import { genkit } from 'genkit';
import { goodmem } from 'genkitx-goodmem';

const ai = genkit({
  plugins: [
    goodmem({
      baseUrl: process.env.GOODMEM_BASE_URL || 'https://your-goodmem-server.example.com',
      apiKey: process.env.GOODMEM_API_KEY!,
    }),
  ],
});

Once the plugin is loaded, 11 tools are registered and available to any Genkit agent or flow.

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 npm package page.