From 809bccfbe7e90b747fac8f73a5a2410c23a3516e Mon Sep 17 00:00:00 2001 From: kartik-mem0 Date: Wed, 12 Aug 2026 19:30:30 +0530 Subject: [PATCH] fix(docs): correct embeddings provider count and guard the table against drift The refreshed provider table said 12 embedders; EmbedderFactory registers 11. The other three rows were right, so the table drifted silently again inside the commit that was fixing it drifting. Add tests/test_agents_md_provider_counts.py, which parses the AGENTS.md provider table and asserts each documented count equals len(.provider_to_class). Verified it fails on the 12 and passes on 11. --- AGENTS.md | 2 +- tests/test_agents_md_provider_counts.py | 37 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/test_agents_md_provider_counts.py diff --git a/AGENTS.md b/AGENTS.md index 502c27b8b..d39b97514 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -342,7 +342,7 @@ The SDK uses a consistent plugin architecture across 4 categories. Each category |----------|-------|---------| | **LLMs** | 18 | OpenAI, Anthropic, AWS Bedrock, Azure OpenAI, Gemini, Groq, Ollama, Together, DeepSeek, vLLM, LiteLLM, LM Studio, xAI | | **Vector Stores** | 25 | Qdrant, Pinecone, Chroma, Weaviate, Milvus, MongoDB, Redis, Elasticsearch, pgvector, Supabase, Faiss, S3 Vectors | -| **Embeddings** | 12 | OpenAI, Azure OpenAI, Gemini, HuggingFace, FastEmbed, Together, AWS Bedrock, Ollama, Vertex AI | +| **Embeddings** | 11 | OpenAI, Azure OpenAI, Gemini, HuggingFace, FastEmbed, Together, AWS Bedrock, Ollama, Vertex AI | | **Rerankers** | 5 | Cohere, HuggingFace, LLM-based, Sentence Transformer, Zero Entropy | ### Two Usage Modes diff --git a/tests/test_agents_md_provider_counts.py b/tests/test_agents_md_provider_counts.py new file mode 100644 index 000000000..346b9e21b --- /dev/null +++ b/tests/test_agents_md_provider_counts.py @@ -0,0 +1,37 @@ +"""Drift test: the provider counts in AGENTS.md must match the factory registries.""" + +import re +from pathlib import Path + +import pytest + +from mem0.utils.factory import ( + EmbedderFactory, + LlmFactory, + RerankerFactory, + VectorStoreFactory, +) + +AGENTS_MD = Path(__file__).resolve().parents[1] / "AGENTS.md" + +ROW_TO_FACTORY = { + "LLMs": LlmFactory, + "Vector Stores": VectorStoreFactory, + "Embeddings": EmbedderFactory, + "Rerankers": RerankerFactory, +} + + +def _documented_counts() -> dict[str, int]: + rows = re.findall(r"^\|\s*\*\*(.+?)\*\*\s*\|\s*(\d+)\s*\|", AGENTS_MD.read_text(), re.M) + return {name: int(count) for name, count in rows} + + +@pytest.mark.parametrize("row_name,factory", ROW_TO_FACTORY.items()) +def test_documented_count_matches_registry(row_name, factory): + documented = _documented_counts() + assert row_name in documented, f"AGENTS.md provider table has no {row_name!r} row" + assert documented[row_name] == len(factory.provider_to_class), ( + f"AGENTS.md says {documented[row_name]} {row_name} but " + f"{factory.__name__}.provider_to_class has {len(factory.provider_to_class)}" + )