Stores, searches, ranks, and deletes agent memories using local embeddings, PostgreSQL, and recency-aware scoring.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Memex.
The ayushagrawal288/memex MCP server gives AI agents persistent storage for facts, preferences, past events, and procedures. It stores memories for an agent and user, generates an embedding locally, and saves the record in PostgreSQL with pgvector. Agents can then search those records semantically instead of receiving only the most recent or exact-text matches.
Memory records support three types: episodic for events and conversations, semantic for facts and preferences, and procedural for workflows or instructions. The service also supports deleting a memory and counting memories associated with an agent or user.
On a write, the service passes the memory content through fastembed using the local BAAI/bge-small-en-v1.5 ONNX model. The resulting 384-dimensional vector is inserted into PostgreSQL. No external embedding request is needed.
On a search, the query is embedded with the same local model. PostgreSQL uses a cosine-similarity pgvector query to select three times the requested number of candidates. Python then reranks those candidates using a configurable blend of semantic similarity and age:
score = ฮฑ ร cosine_similarity + (1 โ ฮฑ) ร exp(โฮป ร age_days)
The default semantic-weight parameter is alpha=0.7, and the default recency half-life is 30 days. Higher alpha values favor semantic similarity; lower values give recency more influence. The database uses an ivfflat index, intended by the project for small-to-medium collections.
The ayushagrawal288/memex MCP server is designed to run locally with Docker and Docker Compose. Clone the repository, change into its directory, and run docker compose up. The REST API is available at http://localhost:8000, with interactive documentation at /docs. The project also contains an MCP FastAPI process configured on port 8001 and identifies its MCP transport as Streamable HTTP.
The stack includes PostgreSQL 16, the pgvector extension, and an asyncpg connection pool. The default pool limits are five minimum and 20 maximum connections; DB_MAX_POOL_SIZE can override the maximum. The README states that no API keys are required and that the complete stack runs locally.
The MCP tool definitions cover four operations:
The corresponding REST API provides memory creation, search, deletion, and count routes. Health and readiness checks are available, and a metrics endpoint exposes Prometheus metrics. The repository also includes background summarization using a local extractive summarizer based on deduplication and term-frequency scoring.
Local ONNX inference is required for both writes and searches, so CPU capacity affects throughput. Reported tests used a MacBook M-series machine with Docker Desktop and found roughly 120 requests per second in aggregate under the stated test configuration; saturation caused multi-second latency. These figures are environment-specific rather than a service guarantee.
The ivfflat configuration is aimed at collections below about one million vectors. The project notes that larger deployments may benefit from moving scoring into PostgreSQL, changing to HNSW, adding embedding caching, or scaling horizontally. Those approaches are described as future or scaling options, not default behavior.
The ayushagrawal288/memex MCP server does not provide a hosted cloud dependency in the documented setup. Deployers remain responsible for running Docker, PostgreSQL, and the service processes.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ayushagrawal288-memex)<a href="https://allmcps.com/mcp/ayushagrawal288-memex"><img src="https://allmcps.com/api/badge/ayushagrawal288-memex?style=directory" alt="Memex on AllMCPs" /></a>