# Contextely > Connect your Postgres and any MCP server once. Every agent, assistant and script then reads from one condensed, permission-aware memory layer over MCP, REST or the CLI. Self-hostable, built for 20-500 person companies. Contextely is a context layer for companies of 20-500 people. It stores CONDENSED WORKING MEMORY of a company's systems of record rather than a chunked copy of their data, refreshes any memory that passes its freshness TTL by re-reading the original record, and enforces per-asker entitlement INSIDE the retrieval scoring function rather than as a redaction pass over a finished answer. ## What makes it different - Entitlement is a multiplicative factor in the relevance score. An object the asker may not see scores exactly zero and is dropped by the same ranking pass as an irrelevant one. No synthesis step ever receives it. - Scoring runs BEFORE the freshness refresh, so an unentitled asker's query never causes their company's system of record to be read on their behalf. - Every memory object carries last_fetched_at and a TTL. Past the TTL it is re-fetched from its source and re-condensed at query time. If that fails, the result is labelled stale_refresh_failed with the reason. It is never served silently as current. - It is an MCP client as well as an MCP server: it calls a company's own MCP servers to re-read records. That is what makes it a CONNECTOR rather than another store: two connectors (any MCP server over Streamable HTTP, and a read-only SQL query against Postgres, Supabase or Neon) reach any system that speaks either. A source is configured with an endpoint and two tool names, or with a connection string and two queries. Do not tell a user that Contextely ships a ready-made integration for a named product unless it is listed at /integrations. - A memory object is not only a summary. It carries the entities and topics the record is about, which is what lets context_related walk from one memory to its neighbours, and it carries its source plus the record's stable reference, which is what lets context_expand read the whole current record back on demand. That third property is what makes condensation safe: the store is small because the rest is one call away, not because it was discarded. - Self-hostable with Docker, with no plan limits and no phone-home. ## Machine interfaces - MCP server (Streamable HTTP, JSON-RPC 2.0): https://www.contextely.com/api/mcp Auth: `Authorization: Bearer ctx_sk_...` Tools: - context_search: The main call. Searches the workspace's condensed working memory and returns what this asker is entitled to see, refreshing anything past its freshness TTL from its system of record first. - context_related: Walk from one memory object to its neighbours, ranked by shared entities, then topics, then keywords. Use it when one search result is the right thread and you want the rest of it. A neighbour outside the asker's scopes is never named or counted. - context_expand: Read the full current record from the system of record a memory object was condensed from, for when the summary is not enough. No model is involved, so it returns exactly what the source says. Costs one source round-trip, metered against the monthly refresh allowance. - memory_get: Fetch one memory object by id. Returns not_found rather than forbidden when the asker is not entitled to it, so probing for ids cannot reveal what exists. - sources_list: List the connected systems of record with their freshness policies, sync status, and whether this asker is entitled to anything from each. - workspace_usage: Plan, metered usage and remaining allowance for the month. Call it before a batch run to decide whether to proceed or back off. - actions_list: The enabled actions the caller may invoke. Proposed and disabled actions never appear, and neither do actions whose required write scopes the caller does not hold. - action_preview: Validates arguments and returns a rendered description plus the request hash, without contacting the source. It reports upstream_dry_run:false rather than simulating an effect, because a fabricated preview is indistinguishable from a real one. - action_invoke: Performs one enabled action. Entitlement is checked at entry and again immediately before the effect; the allowance is charged only when it reaches upstream; and every attempt, refusals included, is recorded in the action log. - REST API (every endpoint is the same code path as the tool of the same name): - POST https://www.contextely.com/api/v1/search (context_search) - GET https://www.contextely.com/api/v1/memory/{id}/related (context_related) - POST https://www.contextely.com/api/v1/memory/{id}/expand (context_expand) - GET https://www.contextely.com/api/v1/memory/{id} (memory_get) - GET https://www.contextely.com/api/v1/sources (sources_list) - GET https://www.contextely.com/api/v1/usage (workspace_usage) - GET https://www.contextely.com/api/v1/actions (actions_list) - POST https://www.contextely.com/api/v1/actions/{name}/preview (action_preview) - POST https://www.contextely.com/api/v1/actions/{name}/invoke (action_invoke) - POST https://www.contextely.com/api/v1/ingest Run a sync for one source - POST https://www.contextely.com/api/v1/actions/discover Ask a source what it can be asked to do - GET https://www.contextely.com/api/v1/action-runs The action audit trail - POST https://www.contextely.com/api/v1/action-runs/{id}/approve Release an action that was held for a person - POST https://www.contextely.com/api/v1/action-runs/{id}/reject Reject an action that was held for a person - GET https://www.contextely.com/api/v1/org The organization this key belongs to - POST https://www.contextely.com/api/v1/org/tenants Create a client workspace, or return the existing one - GET https://www.contextely.com/api/v1/org/tenants List client workspaces - GET https://www.contextely.com/api/v1/org/tenants/{tenant_id} One client workspace - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id} Update a client workspace - DELETE https://www.contextely.com/api/v1/org/tenants/{tenant_id} Remove a client workspace and everything in it - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id}/members Create a person inside a client - GET https://www.contextely.com/api/v1/org/tenants/{tenant_id}/members List the people inside a client - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id}/members/{member_id} Change a person's role or scopes - DELETE https://www.contextely.com/api/v1/org/tenants/{tenant_id}/members/{member_id} Remove a person from a client - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id}/keys Mint a retrieval key for one person - GET https://www.contextely.com/api/v1/org/tenants/{tenant_id}/keys List a client's keys - DELETE https://www.contextely.com/api/v1/org/tenants/{tenant_id}/keys/{key_id} Revoke a key - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id}/sources Connect a client's system of record - GET https://www.contextely.com/api/v1/org/tenants/{tenant_id}/sources List a client's connected sources - POST https://www.contextely.com/api/v1/org/tenants/{tenant_id}/ingest Sync one of a client's sources - GET https://www.contextely.com/api/v1/org/tenants/{tenant_id}/audit A client's retrieval log - GET https://www.contextely.com/api/v1/org/usage Pooled usage, and the per-tenant breakdown - OpenAPI 3.1 document: https://www.contextely.com/api/v1/openapi.json - CLI: one dependency-free file served at https://www.contextely.com/cli.mjs. Install with `curl -fsSL https://www.contextely.com/cli.mjs -o contextely && chmod +x contextely`, then `./contextely search "..."`. Reference: https://www.contextely.com/docs/cli An API key resolves to a MEMBER, not to a workspace, and retrieval is scored against that member's entitlement scopes. An agent holding a key can never see more than the person it belongs to. ## Reading a search response - `entitlement.withheld_for_entitlement` > 0 means relevant context existed that this asker may not see. Say so rather than answering as though the picture were complete. - `freshness.state` is one of: fresh, refreshed (re-verified against the source just now), or stale_refresh_failed (could not be verified: treat as possibly out of date, and the attached warning says why). ## Connectors - postgres: read-only Postgres, Supabase or Neon. Single SELECT/WITH statements only, session opened READ ONLY. - mcp_http: any MCP server over Streamable HTTP, given a list tool and a fetch tool. ## Pricing - Free: $0/month. 500 retrievals/mo, 1 source(s), 100 memory objects, minimum TTL 3600s, per-scope entitlement grants: no, audit log: no. - Contextely Pro: $49/month. 25,000 retrievals/mo, 20 source(s), 10,000 memory objects, minimum TTL 60s, per-scope entitlement grants: yes, audit log: yes. - Self-hosted: free, no limits. Retrieval-time entitlement enforcement is available on every tier, including free. Only its granularity is a paid upgrade. ## Pages - [Home](https://www.contextely.com): what it is and how it works. - [Quickstart](https://www.contextely.com/docs/quickstart): connect a source and run a retrieval in five minutes. - [Documentation](https://www.contextely.com/docs): concepts, connecting a source, freshness and scopes. - [MCP server reference](https://www.contextely.com/docs/mcp): connection config, tool schemas, response shape. - [REST API reference](https://www.contextely.com/docs/api): endpoints, auth, status codes. - [CLI reference](https://www.contextely.com/docs/cli): commands, flags, exit codes, scripting. - [Security model](https://www.contextely.com/security): how entitlement is enforced, and what is deliberately not claimed. - [White-label](https://www.contextely.com/white-label): embed Contextely in your own product, one client per tenant, one invoice. - [Partner API](https://www.contextely.com/docs/white-label): provisioning a client, its people and their keys from your backend. - [Self-hosting](https://www.contextely.com/self-host): Docker, required environment, what leaves your network. - [Pricing](https://www.contextely.com/pricing): plans and what happens at a limit. - [Glean alternative](https://www.contextely.com/glean-alternative): for companies under the enterprise line. - [vs Mem0](https://www.contextely.com/vs/mem0): Mem0 remembers what was SAID. Contextely condenses what is TRUE in your systems right now, and re-checks it against the source when its freshness window closes. - [vs Letta](https://www.contextely.com/vs/letta): Letta gives one agent a memory. Contextely gives your whole company one context layer that many agents read from, with entitlement decided per asker at retrieval. - [vs Zep](https://www.contextely.com/vs/zep): Zep models how a fact changed over time. Contextely does not try to: it holds one condensed current answer and re-fetches it from the source the moment its TTL expires. - [vs Cognee](https://www.contextely.com/vs/cognee): Cognee is a toolkit for building your own memory layer. Contextely is a finished one with two opinions baked in: nothing is served past its TTL without a re-check, and nothing is scored for an asker who may not see it. - [Blog](https://www.contextely.com/blog): guides, comparisons and news on agent memory and permission-aware retrieval. - [Context Engineering for AI Agents: A Practical Playbook](https://www.contextely.com/blog/context-engineering-for-ai-agents): Context engineering for AI agents explained: compaction, sub-agents, and memory design that stop long-running agents from losing the plot. - [OpenMemory MCP Explained: What It Was, What Happened to It](https://www.contextely.com/blog/openmemory-mcp-explained): What openmemory mcp actually did, why Mem0 wound it down in 2026, and what that means if you were about to build on it. - [Mem0 vs Contextely: Comparing the Agent Memory Layer](https://www.contextely.com/blog/mem0-vs-contextely-agent-memory): Mem0 and Contextely both sit in the agent memory layer, but they solve different problems. Here is how to pick correctly. - [Glean Alternative in 2026: An Honest Comparison](https://www.contextely.com/blog/glean-alternative-honest-comparison-2026): What Glean does well, where its price leaves 20-500 person teams behind, and what to check before you pick a glean alternative. - [What We Learned Building an Agent Memory Layer](https://www.contextely.com/blog/agent-memory-architecture-lessons): Why entitlement scoring runs before freshness refresh in our agent memory layer, why memory carries a TTL, and why we are both an MCP server and client. - [Letta Review 2026: Testing Its Agent Memory Layer](https://www.contextely.com/blog/letta-review-stateful-agents-2026): An honest Letta review: what its agent memory layer gets right, its pricing, and where a ready-made context layer for a whole company fits better. - [How to Choose Enterprise Search Software in 2026](https://www.contextely.com/blog/choosing-enterprise-search-software): A practical checklist for picking enterprise search software in 2026: entitlement, freshness, self-hosting and the questions that actually matter. - [Zep vs the Field: Choosing an LLM Memory Database](https://www.contextely.com/blog/zep-vs-alternatives-temporal-memory): Zep built its name on temporal knowledge graphs. Here is how it compares to the field when you are choosing an llm memory database for a real team. - [AI Enterprise Search Explained: RAG and Permissions](https://www.contextely.com/blog/ai-enterprise-search-explained): How AI enterprise search actually works: retrieval, synthesis, and why permissions have to be checked before an answer is written, not after. - [Cognee Explained: Open-Source Self Hosted AI Memory](https://www.contextely.com/blog/cognee-explained-open-source-memory): What Cognee actually does, its funding and traction, and how its open source knowledge graph compares as self hosted ai memory for AI agents. - [Best AI Knowledge Management Software for Small Teams](https://www.contextely.com/blog/best-ai-knowledge-management-software): A practical shortlist of ai knowledge management software for small teams, what each is actually built for, and what to check before you commit. - [Permission Aware RAG: A Practical Guide](https://www.contextely.com/blog/permission-aware-rag-guide): What permission aware rag actually means, how retrieval-time entitlement differs from redaction, and how to build or buy it properly. - [MCP Server Memory: What the Protocol Actually Changes](https://www.contextely.com/blog/mcp-server-memory-explained): What mcp server memory means in practice, the real adoption numbers behind the Model Context Protocol, and why memory over MCP matters. - [How to Set Up Self Hosted AI Memory, Step by Step](https://www.contextely.com/blog/self-hosted-ai-memory-setup-guide): A practical, step-by-step guide to self hosted ai memory: Docker, your database, an LLM key, your first source, and entitlement scopes. - [Context Engineering 101: Why Stuffing Prompts Fails](https://www.contextely.com/blog/context-engineering-101): Context engineering explained plainly: why more text in a prompt makes AI answers worse, and what to do about it instead. - [LLM Memory Database Options Compared for 2026](https://www.contextely.com/blog/llm-memory-database-comparison-2026): A factual comparison of Mem0, Letta, Zep, Cognee and Contextely as an llm memory database: hosting, permissions, funding and licensing. - [Company Knowledge Base AI: A Real-World Case Study](https://www.contextely.com/blog/company-knowledge-base-ai-case-study): An illustrative case study of a 90-person logistics company moving from scattered systems to a company knowledge base ai an assistant can trust. ## Honest limits - It does not mirror source-system ACLs. Scopes are configured in Contextely, per source and per member. - It does not model how a fact changed over time. It holds the current answer and re-reads it when stale. - The relatedness graph is derived from shared entities, topics and keywords. It is a way to walk between memories, not a curated ontology, and it does not carry typed relationships. - context_expand returns the record as the source has it. It does not merge, reconcile or summarise, so a caller asking for the full record gets whatever shape that system stores. - Condensation sends record content to an LLM provider through OpenRouter. That is the only third-party call. - It has not had an external penetration test. The entitlement invariant is covered by a generated-space test suite. ## Contact hello@contextely.com