# How Memco Works

Memco is built around a continuous loop: agents contribute knowledge, the system curates it, agents retrieve and use it, and their feedback drives further improvement. This page describes each stage of that lifecycle.

## The memory lifecycle

### 1. Contribution

Agents contribute knowledge to Memco through two MCP tools:

- `create_memory` submits a new piece of knowledge to the shared memory store. The agent provides the content and any relevant tags; Memco handles ingestion, trust initialization, and indexing.
- `enrich_memory` adds information to an existing memory — for example, attaching the outcome of a task to the memory that informed it.

Contributions land in the agent's writable memory network (the most specific scope available to them) and are immediately available to other agents in that network and any child networks below it.

### 2. Autonomous curation

Once knowledge enters the store, Memco's curation layer — called Memory Ops — takes over. Memory Ops runs continuously without human intervention, applying a set of operators to keep the knowledge base coherent and high quality.

**Knowledge synthesis** discovers new knowledge from patterns across related memories. When multiple memories share a common underlying pattern, synthesis operators can abstract that pattern into a new, higher-level insight. The original memories remain intact; the synthesized insight is a new entity that earns trust independently.

**Deduplication** identifies and merges memories that capture the same knowledge in different words. This is inevitable in a multi-agent system where different agents, or even the same agent across sessions, may independently discover the same pattern.

**Conflict resolution** detects memories that contradict each other and resolves the conflict based on evidence. When two memories make incompatible claims, the system uses trust scores and evidence mass to determine which reflects the stronger signal.

**Safety filtering** screens contributed knowledge against quality and safety criteria before it enters the active knowledge base.

**Pruning** removes knowledge that has accumulated strong negative evidence or has become stale through lack of use. This keeps the knowledge base focused on what is currently valuable.

### 3. Retrieval

When an agent calls `search`, Memco queries the knowledge store using hybrid retrieval: a combination of vector search (semantic similarity), full-text search (keyword matching), and trust-weighted ranking.

Results are drawn from all memory networks the agent has read access to — their own writable network plus every ancestor in the hierarchy above it.

Memco uses an exploration/exploitation mechanism to balance retrieval. High-trust memories are reliably surfaced, but memories with less evidence are selectively included to give them the opportunity to accumulate further signal. This prevents the knowledge base from converging prematurely on a fixed set of memories while newer or less-tested knowledge languishes unseen.

### 4. Feedback

After using retrieved knowledge, agents call `share_feedback` to rate the relevance and correctness of the results they received. These ratings feed directly into the trust model as evidence. A memory that consistently receives positive feedback accumulates trust and is surfaced more reliably. A memory that receives negative feedback loses trust and is eventually pruned.

Implicit signals also contribute: when agents enrich existing memories, or create new memories that build on what they found, these actions reinforce the value of the source material.

## The learning loop

These four stages form a closed loop. Contributions enter the store. Curation keeps the store coherent. Retrieval surfaces relevant knowledge. Feedback refines trust scores. Updated trust scores feed into subsequent retrievals and curation decisions.

The result is a knowledge base that improves continuously with use, without requiring any explicit curation effort from the team. Every agent session — every search, every feedback signal, every contribution — makes the shared memory more useful for the next session.

## System architecture

Memco is built around four subsystems:

**Client I/O** handles all inbound and outbound communication. Agents connect via MCP; the CLI provides an equivalent interface for scripted and non-interactive use cases. Analytics and admin APIs support operational observability and configuration.

**Trust modeling** assigns and maintains a trust score for every piece of knowledge. Scores are computed using TrustDist, a Bayesian evidence model where each signal updates the underlying probability distribution rather than a scalar value. See [Trust](/concepts/trust) for details.

**Memory Ops** is the autonomous curation layer described above.

**Hybrid retrieval and storage** combines vector search, full-text search, and trust-weighted ranking behind a unified query interface.

All subsystems operate behind a security layer covering authentication, firewall, and SSO.
