Troubleshooting¶
When this repository misbehaves, the failures usually fall into one of a small number of buckets:
import or dependency problems
goodmemis required for transport-backed workflows, andlangchain-openaiis required forGoodMemEmbeddingsmissing environment variables public usage needs
GOODMEM_API_KEYandGOODMEM_BASE_URL; live embeddings coverage andGoodMemEmbeddings.ensure_from_env(...)may also needGOODMEM_EMBEDDINGS_*, andGOODMEM_EMBEDDER_IDreuse still requires those bootstrap values to match the selected embedderfilter expression mistakes GoodMem filters are their own language and operate on memory-level metadata, not on chunk-level result objects
eventual consistency surprises a successful write does not guarantee that the memory is immediately searchable, because GoodMem still needs to process it into chunks
Good references while debugging:
the public
embeddingsandvectorstoresmodule docstrings for user-facing setup and failure behaviortests._integration_live_supportfor the exact live-test environment policythe official GoodMem filter expressions reference when a filter is rejected by the backend
LangChain embeddings adapter for GoodMem-managed embedders.
GoodMemEmbeddings turns one existing GoodMem embedder resource into a
LangChain Embeddings implementation, but only when that GoodMem embedder is
compatible with an OPENAI-style upstream embeddings endpoint.
Use this adapter when you need local LangChain embedding calls such as
embed_query(...) or embed_documents(...), or when you want
GoodMemVectorStore.create(..., embedding=...) to both create a space and
retain a LangChain Embeddings object on the returned store.
You do not need GoodMemEmbeddings just to search an existing GoodMem space.
GoodMemVectorStore(space_id=..., ...) can retrieve directly from GoodMem
without any local embeddings object.
Credential resolution order:
readable inline API key stored on the GoodMem embedder
GOODMEM_EMBEDDINGS_API_KEY
For clean-slate onboarding, GoodMemEmbeddings.ensure(...) and
GoodMemEmbeddings.ensure_from_env(...) can find or create one compatible
GoodMem embedder before returning a normal GoodMemEmbeddings instance.
ensure_from_env(...) also supports GOODMEM_EMBEDDER_ID reuse, but when
that path is used the bootstrap environment must still be present and must
match the selected embedder so configuration drift stays explicit. For broader
RAG-resource setup such as spaces, memories, and one-shot vector-store
bootstrap, use GoodMemResources.
Additional environment support:
GOODMEM_EMBEDDINGS_DIMENSIONSremains optional, but when set it must match the dimensionality declared on the selected GoodMem embedderGOODMEM_EMBEDDINGS_BASE_URL,GOODMEM_EMBEDDINGS_MODEL_IDENTIFIER, andGOODMEM_EMBEDDINGS_DIMENSIONSare required byGoodMemEmbeddings.ensure_from_env(...)even when that helper reuses an existingGOODMEM_EMBEDDER_ID
Common setup failures covered by this module include:
missing optional
langchain-openaidependencyunsupported provider type or modality
upstream credential forwarding that GoodMem cannot perform directly
provider initialization or request failures, which normalize to
GoodMemAPIError
LangChain vector-store integration backed by GoodMem semantic retrieval.
This module is the main public workflow surface for the repository.
Two primary usage modes are supported:
bind to an existing GoodMem space with
GoodMemVectorStore(...)create a new GoodMem space with
GoodMemVectorStore.create(...)
GoodMem uses three related concepts that map differently to LangChain:
a
spaceis the search scopea
memoryis one stored item of source content plus metadataa
chunkis a searchable fragment produced by GoodMem from a memory
Write methods in this module create memories. Retrieval methods return chunks. One memory can therefore produce multiple search results over time.
Write behavior is intentionally explicit:
caller-provided IDs are treated as memory IDs with strict create-if-absent semantics
Document.idis used as a fallback memory ID source inadd_documents(...)duplicate IDs in a single call raise
GoodMemDuplicateIDErrorbefore any backend call
Search behavior is chunk-level:
Document.idin search results is the GoodMemchunk_idthe parent memory ID is preserved in
Document.metadataas_goodmem_memory_idthe originating space ID is preserved in
Document.metadataas_goodmem_space_idscored results also expose
_goodmem_scorein metadata
Metadata filters are passed through to GoodMem unchanged. They operate on the
memory-level metadata JSON attached to each stored memory, not on LangChain
Document.metadata after conversion and not on chunk text. The documented
GoodMem filter language uses helpers such as val('$.field') and
exists('$.array[*]'). A minimal equality example is
val('$.lang') = 'en'.
GoodMem processes new memories asynchronously before they become searchable, so fresh writes may not appear in retrieval results immediately.
The create helper intentionally keeps a minimal LangChain-facing surface. If
you need GoodMem resource helpers around the normal RAG/search path, use
GoodMemResources. Broader platform administration remains outside this
LangChain integration.
Live integration-test helpers and environment contract.
This module centralizes the resource lifecycle and environment policy for the repository’s live GoodMem tests.
Required base environment:
GOODMEM_API_KEYGOODMEM_BASE_URL
Optional reuse controls:
GOODMEM_SPACE_IDto reuse an existing space for existing-space coverageGOODMEM_EMBEDDER_IDto reuse an existing compatible embedder
Optional auto-provisioning inputs for embeddings coverage:
GOODMEM_EMBEDDINGS_API_KEYGOODMEM_EMBEDDINGS_BASE_URLGOODMEM_EMBEDDINGS_MODEL_IDENTIFIERGOODMEM_EMBEDDINGS_DIMENSIONSGOODMEM_EMBEDDINGS_PROVIDER_TYPE
Resource lifecycle:
existing resources referenced through environment variables are reused and not deleted
temporary spaces and embedders created by the tests are cleaned up at the end of the run
cleanup failures fail the test run so resource leaks stay visible
Additional behavior:
GOODMEM_VERIFYis parsed only here, not byGoodMemConnection.from_envsemantic retrieval is eventually consistent, so tests poll until the expected chunk becomes visible or the timeout is reached