Files in this release originate from inconsistent repositories or configurations. View details.
A flexible memory system for Gen AI applications
pip install gllm-memory-binary==0.3.8 Copy PIP instructions
Memory layer for AI agents. The public API is MemoryManager. You can use it in two ways:
In SDK mode, you can register your own LLM, embedding model, memory store, and optional reranker without exposing backend-specific config to application code.
from gllm_inference.schema.message import Message from gllm_memory import MemoryManager from gllm_memory.enums import MemoryScope memory_manager = MemoryManager(api_key="your_mem0_api_key") await memory_manager.add( user_id="user_123", agent_id="agent_456", messages=[Message.user("I love pizza")], scopes={MemoryScope.USER}, ) results = await memory_manager.search( query="What does the user like?", user_id="user_123", scopes={MemoryScope.USER}, ) For the recommended SDK mode setup with MemoryManagerConfig, see SDK Mode.
Use this once when you need internal packages or local development setup:
gcloud auth login export UV_INDEX_GEN_AI_INTERNAL_USERNAME=oauth2accesstoken export UV_INDEX_GEN_AI_INTERNAL_PASSWORD="$(gcloud auth print-access-token)" export UV_INDEX_GEN_AI_USERNAME=oauth2accesstoken export UV_INDEX_GEN_AI_PASSWORD="$(gcloud auth print-access-token)" Install from Artifact Registry uv pip install \ --extra-index-url "https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/" \ gllm-memory Install from Local Clone git clone git@github.com:GDP-ADMIN/gl-sdk.git cd gl-sdk/libs/gllm-memory pip install -e . For the full local development setup with project tooling:
make setup source .venv/bin/activate Runtime Notes HTTP mode uses MEM0_API_KEY and optional MEM0_HOST. SDK mode uses MemoryManagerConfig(...) and lets your app register LM, embedding, memory store, and optional retrieval reranker. Optional Dependencies OpenAI-based SDK examples require OpenAI support from gllm-inference, for example gllm-inference[openai]. Knowledge graph examples require the KG dependencies used by this repository setup. Typical environment variables:
Public configuration and provider failures use typed errors with stable GLLM-MEM-* codes. Applications can use error.code to select a user-facing message without depending on provider-specific exception text.
See the Error Code Catalog for each code, its trigger, and recommended recovery action.
Relevant errors also include recovery metadata. Check recovery.retryable before retrying. Retryable errors use the caller_owned policy: the caller sets the retry limit and backoff. When present, wait at least recovery.retry_after_seconds before retrying and use recovery.escalate_when to decide when to escalate the failure.
For public-boundary behavior and documented exceptions, see the Error Boundary Audit.
gllm-memory includes one internal background maintenance job for retrieval-based vector retention, semantic dedupe, and persistent Mem0 SQLite audit-history retention.
You do not call this job directly from MemoryManager. When memory maintenance is enabled, the scheduler is registered automatically during MemoryManager initialization.
The system follows a layered architecture below:
┌──────────────────────────────────────────────────────────────┐ │ Application Layer │ ├──────────────────────────────────────────────────────────────┤ │ Memory Manager │ ├──────────────────────────────────────────────────────────────┤ │ Memory Client (Base) │ ├──────────────────────────────────────────────────────────────┤ │ Provider Layer (Mem0) │ ├──────────────────────────────────────────────────────────────┤ │ Mem0 Platform (HTTP client or Python SDK) │ └──────────────────────────────────────────────────────────────┘
gllm-memory does not create provider-specific LM or embedding invokers for you in normal SDK usage. Your application builds the LM invoker, optional fallback invokers, one embedding invoker, and then wraps the memory LLM path with the library-owned MemoryLMComponent.
from gllm_inference.lm_invoker.lm_invoker import BaseLMInvoker from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker from gllm_memory import MemoryLMComponent, MemoryManagerConfig def build_openai_lm_invoker(model_name: str) -> OpenAILMInvoker: return OpenAILMInvoker( model_name=model_name, api_key="your_openai_api_key", ) def build_fallback_lm_invokers() -> list[BaseLMInvoker]: return [ build_openai_lm_invoker("gpt-4o-mini"), ] def build_lm_component() -> MemoryLMComponent: return MemoryLMComponent( lm_invoker=build_openai_lm_invoker("gpt-5-nano"), fallback_lms=build_fallback_lm_invokers() or None, ) def build_em_invoker(): from gllm_inference.em_invoker.openai_em_invoker import OpenAIEMInvoker return OpenAIEMInvoker( model_name="text-embedding-3-small", api_key="your_openai_api_key", ) lm_component = build_lm_component() em_invoker = build_em_invoker() config = ( MemoryManagerConfig.builder() .memory_store.elasticsearch( host="localhost", port=9200, collection_name="memories", embedding_model_dims=1536, ) .embedding.register( em_invoker, embedding_dims=1536, ) .llm.register_component(lm_component) .reranker.similarity_based( em_invoker, top_k=5, ) .build() ) In this path, em_invoker and the underlying LM invokers are created by your application, while MemoryLMComponent is owned by gllm-memory. MemoryManager.instruction remains the source of truth for memory extraction instructions, and lm_component can route from one primary LM to fallback_lms when the primary LM fails.
The reranker is optional. If you do not need retrieval reranking, omit .reranker.similarity_based(...) from the builder. When configured with similarity_based(...), reranking runs in the external retrieval layer after provider retrieval returns chunks. The provider keeps native backend rerank disabled for this path so the request does not run double reranking. If your installed gllm_inference version still has a circular import on OpenAIEMInvoker, instantiate the EM invoker with a local lazy import like the example above.
If you want to use the default SDK setup, you can build an empty config:
from gllm_memory import MemoryManager, MemoryManagerConfig config = MemoryManagerConfig.builder().build() memory_manager = MemoryManager(config=config) Default SDK behavior:
Required environment variables for the default SDK config:
Use this mode if you want to connect to the HTTP API directly. Point the client at your own server:
memory_manager = MemoryManager(config=config) Recommended setup:
from gllm_inference.lm_invoker.openai_lm_invoker import OpenAILMInvoker from gllm_memory import MemoryManager, MemoryManagerConfig, Neo4jGraphStoreConfig memory_lm_component = build_lm_component() em_invoker = build_em_invoker() kg_lm_invoker = OpenAILMInvoker( model_name="gpt-4o-mini", api_key="your_openai_api_key", ) config = ( MemoryManagerConfig.builder() .memory_store.elasticsearch( host="localhost", port=9200, collection_name="memories", embedding_model_dims=1536, ) .embedding.register( em_invoker, embedding_dims=1536, ) .llm.register_component(memory_lm_component) .knowledge_graph.enable( lm_invoker=kg_lm_invoker, graph_store=Neo4jGraphStoreConfig( uri="bolt://localhost:7687", user="neo4j", password="password", ), ) .build() ) memory_manager = MemoryManager(config=config) MemoryManager enables KG automatically when the config contains a knowledge_graph section.
Detailed KG flows, storage isolation, update behavior, and delete behavior are documented in docs/knowledge-graph.md.
MemoryManager exposes async methods; query is required where noted.
# Format code with ruff ruff format gllm_memory/ tests/ # Check code quality ruff check gllm_memory/ tests/ # Fix auto-fixable issues ruff check gllm_memory/ tests/ --fix Local Development Utilities The following Makefile commands are available for quick operations:
make install-uv Install Pre-Commit make install-pre-commit Install Dependencies make install Update Dependencies make update Run Tests make test Contributing Please refer to the Python Style Guide for information about code style, documentation standards, and SCA requirements.
# Complete setup: installs uv, configures auth, installs packages, sets up pre-commit make setup Activate virtual environment:
source .venv/bin/activate Run tests to ensure everything works:
make test Make your changes and ensure tests pass:
# Make your changes # Ensure tests pass make test Submit a pull request:
# Submit a pull request git push origin your-branch Key dates PyPI data Data sourced directly from PyPI's database. Released: Nov 12, 2026 Latest release 1 maintainer PyPI data Data sourced directly from PyPI's database. glx-sre Credits Author: Gen AI SDK Team
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
These files originate from different repositories or configurations.
We recommend inspecting each repository and configuration before proceeding. View details.
Enable javascript to be able to filter the list of wheel files.
This file belongs to a release with inconsistent provenance: the files in this release originate from different repositories or configurations.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Signed by Google Cloud, verified by PyPI on Nov 12, 2026.
The release files originate from multiple, inconsistent repositories.
While this could reflect a legitimate choice by the project maintainers, it may also indicate that the release has been compromised.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 12, 2026 6 release files Inconsistent provenance
Oct 27, 2026 9 release files Incomplete provenance
Oct 21, 2026 9 release files Incomplete provenance
Oct 21, 2026 3 release files Loss of provenance
Oct 20, 2026 3 release files Loss of provenance
Oct 14, 2026 9 release files Incomplete provenance
Oct 7, 2026 9 release files Incomplete provenance
Sep 30, 2026 9 release files Incomplete provenance
Sep 2, 2026 9 release files Incomplete provenance
Aug 31, 2026 9 release files Incomplete provenance
Aug 31, 2026 3 release files Loss of provenance
Aug 28, 2026 9 release files Incomplete provenance
Aug 26, 2026 9 release files Incomplete provenance
Aug 21, 2026 9 release files Incomplete provenance
Aug 14, 2026 2 release files Loss of provenance
Jul 13, 2026 6 release files Incomplete provenance
Jun 25, 2026 6 release files Incomplete provenance
Jun 18, 2026 6 release files Incomplete provenance
Aug 14, 2026 9 release files Incomplete provenance
Apr 30, 2026 6 release files Incomplete provenance
Mar 26, 2026 6 release files Incomplete provenance
Feb 27, 2026 6 release files Incomplete provenance
Feb 10, 2026 6 release files Incomplete provenance
Feb 9, 2026 6 release files Incomplete provenance
Jan 19, 2026 6 release files Incomplete provenance
Dec 24, 2025 6 release files Incomplete provenance
Dec 19, 2025 6 release files Incomplete provenance




