Memory Modules
This page documents the stable public memory facade.
Stable public memory facade exports.
- class design_research_agents.memory.EmbeddingProvider(*args, **kwargs)[source]
Protocol for converting text payloads into dense vectors.
- embed(texts)[source]
Embed one or more texts.
- Parameters:
texts – Input texts to embed.
- Returns:
Embedding vectors in input order, or
Nonewhen embeddings are unavailable and lexical fallback should be used.
- property model_name
Return stable embedding model identifier.
- Returns:
Stable embedding model identifier.
- class design_research_agents.memory.LLMEmbeddingProvider(*, llm_client, model=None, enable_lexical_fallback=True)[source]
Embedding adapter that delegates to an LLM client/backend when available.
Initialize one embedding adapter from an existing LLM client.
- Parameters:
llm_client – LLM client instance that may expose embeddings.
model – Optional explicit embedding model identifier.
enable_lexical_fallback – Return
Noneinstead of raising when embeddings are unsupported.
- embed(texts)[source]
Embed texts through available client/backend embedding APIs.
- Parameters:
texts – Input texts to embed.
- Returns:
List of vectors, or
Nonewhen lexical fallback is enabled and embeddings are unavailable.- Raises:
Exception – Raised when embeddings fail and lexical fallback is disabled.
- property model_name
Return configured embedding model identifier.
- Returns:
Resolved embedding model identifier.
- class design_research_agents.memory.SQLiteMemoryStore(*, db_path=None, embedding_provider=None, embedding_model=None)[source]
Persistent local memory store with optional embedding-based retrieval.
Initialize a local sqlite memory store.
- Parameters:
db_path – Optional sqlite database file path.
embedding_provider – Optional embedding provider for vector retrieval.
embedding_model – Optional model key used for embedding rows.
- close()[source]
Close sqlite connection.
- property db_path
Return sqlite database path used by this store.
- Returns:
Configured sqlite database path.
- search(query)[source]
Search records using lexical relevance and optional vector similarity.
- Parameters:
query – Structured memory search query.
- Returns:
Ranked memory records matching the query.
- write(records, *, namespace='default')[source]
Persist records and return normalized stored records.
- Parameters:
records – Memory record payloads to persist.
namespace – Namespace partition for writes.
- Returns:
Stored records in caller-provided order.