Peer-to-Peer Sync Mechanism in server-noonien Project
The server-noonien project introduces a peer-to-peer sync mechanism that eliminates the need for centralized servers or shared folders, relying solely on IP reachability over a LAN or a VPN.
Peer-to-Peer Sync Mechanism
The server-noonien project introduces a peer-to-peer sync mechanism that eliminates the need for centralized servers or shared folders. According to Hacker News Show, the nooniend daemon facilitates direct replication of each node's shard to other machines, enabling multiple devices to share a single memory space. This approach relies solely on IP reachability over a LAN or a VPN, as noted in Hacker News Show, ensuring that no shared folder or hosted service is required. Hacker News Show further clarifies that peer-to-peer sync with nooniend does not depend on shared folders or buckets, making it a viable alternative to traditional file or S3-based transport methods. This decentralized model offers a unique way to synchronize memory across machines without relying on external infrastructure.
Conflict Resolution and Data Handling
Conflict resolution and data handling in server-noonien rely on a decentralized, append-only approach. Each machine writes only its own shard (.jsonl), ensuring a single-writer rule that prevents concurrent modifications to the same file. This design eliminates the need for a central server to serialize mutations, as described in Hacker News Show, where a last-write-wins strategy would otherwise discard changes. Instead, Hacker News Show explains that shards are isolated by design, and conflicts are managed by treating forked copies as additional shards to be merged later. The MCP server on each node adheres to this model, maintaining replicas of peer shards but only pushing its own authored shard, as noted in Hacker News Show. This approach ensures that conflicts are minimized and resolved through structured merging rather than arbitrary overwrites.
Installation and Configuration
Installation of server-noonien involves a single global npm command, which adds three tools to your system's PATH: the MCP memory server, the maintenance CLI (noonien), and the peer-to-peer replication daemon (nooniend). The MCP memory server is short-lived and is spawned by the MCP client over stdio. The noonien CLI is a one-shot tool meant to be run manually, while nooniend is a long-lived process that runs one per machine. Only server-noonien matches the package name, so it is the only command npx can run by package name. To use it, run npx -y server-noonien, which starts the MCP memory server over stdio. This is typically initiated by the client, not manually, and it lives for the session. In OpenCode (V2), the configuration specifies the server-noonien command and environment variables, such as NOONIEN_DIR, to define how the memory server is launched locally.
Storage and Backend Options
The server-noonien project offers multiple backend options for managing agent memory across distributed systems. For local setups, the file backend stores shards as *.jsonl files within a specified directory (NOONIEN_DIR), which must be replicated using tools like Syncthing, Dropbox, or a shared mount. Alternatively, the s3 backend uses Amazon S3 to store one object per shard, employing conditional writes and retries to handle contention, leveraging the @aws-sdk/client-s3 library. For temporary or testing purposes, the memory backend keeps shards in process memory only, suitable for short-lived sessions. Each node must be configured with a unique NOONIEN_NODE_ID and directed to the same shared area to ensure synchronization across machines. These options provide flexibility depending on deployment needs and infrastructure availability.
Replication and Maintenance
Replication and maintenance in server-noonien are designed to be conflict-free and decentralized. Each daemon maintains a full replica of other shards locally, without requiring a shared directory or centralized server. The system avoids unnecessary replication by refusing to run with certain backends, such as S3 or memory, where it would otherwise replicate a local folder the server does not use. Shard maintenance is optimized: it only adds data, eliminating the need for peer knowledge or garbage collection promises. Tools like noonien import and noonien compact prune data efficiently, retaining tombstones and rewriting only when necessary. This ensures maintenance costs remain minimal, and no peer is required to re-pull the shard. Peers discover each other automatically through configuration options like NOONIEND_TAILSCALE or by seeding a reachable peer, without the need to explicitly list machines.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.