Skip to content

Sync & Pull

Kanoniv's sync and pull commands let you share project knowledge across all agents connected to your tenant. Push local files (CLAUDE.md, memory, skills) to the cloud so any agent - on any machine, in any client - starts with full context.

This is cross-agent knowledge sharing without a shared filesystem.

Why This Matters

Every AI coding agent starts cold. It reads your CLAUDE.md, scans the repo, builds context from scratch. If you have three agents working on the same codebase, each one repeats this work independently.

Sync eliminates this. Push your project knowledge once. Every agent that connects to the same Kanoniv tenant gets it instantly via search_memory.

Commands

npx @kanoniv/mcp sync

Pushes local project knowledge to Kanoniv Cloud. Scans for:

  • CLAUDE.md and .claude/ directory files
  • Memory files (.claude/memory/)
  • Skills and conventions
  • Any .md files you want agents to share
bash
$ npx @kanoniv/mcp sync

Syncing project knowledge to Kanoniv Cloud...
  CLAUDE.md                          -> synced (2.4 KB)
  .claude/memory/MEMORY.md           -> synced (8.1 KB)
  .claude/memory/architecture.md     -> synced (3.2 KB)
  .claude/memory/patterns.md         -> synced (1.8 KB)

4 entries synced. All agents on this tenant now have access.

Under the hood, sync calls the Knowledge Sync API with entry_type: "knowledge". Entries are keyed by slug (derived from filename), so re-syncing updates existing entries rather than creating duplicates.

npx @kanoniv/mcp pull

Downloads cloud knowledge to local files. Useful when switching machines or onboarding a new agent.

bash
$ npx @kanoniv/mcp pull

Pulling knowledge from Kanoniv Cloud...
  CLAUDE.md                          -> pulled (2.4 KB)
  memory/MEMORY.md                   -> pulled (8.1 KB)
  memory/architecture.md             -> pulled (3.2 KB)
  memory/patterns.md                 -> pulled (1.8 KB)

4 entries pulled to .claude/

npx @kanoniv/mcp log

Unified activity stream across all agents. Shows identity events, memory entries, and tasks in chronological order, color-coded by type.

bash
$ npx @kanoniv/mcp log

[14:30:02] RESOLVE  sdr-agent       [email protected] -> ENT_7f82 (merge, 0.94)
[14:30:03] MEMORY   sdr-agent       Stored: "Qualified as enterprise lead"
[14:30:05] RESOLVE  enrichment-bot  (555) 010-1234 -> ENT_7f82 (merge, 0.91)
[14:30:06] MEMORY   enrichment-bot  Stored: "Enriched via LinkedIn"
[14:30:08] TASK     sdr-agent       Created: "Follow up with Acme Corp" -> crm-agent
[14:30:10] INTENT   crm-agent       Declared: "Syncing ENT_7f82 to Salesforce"
[14:30:12] RESOLVE  crm-agent       [email protected] -> ENT_7f82 (existing)
[14:30:13] MEMORY   crm-agent       Stored: "Synced to Salesforce"

Options:

FlagDescription
--since <duration>Show events from the last N minutes/hours (e.g. --since 1h)
--agent <name>Filter by agent name
--type <type>Filter by event type: resolve, memory, task, intent, merge
--followStream events in real-time

npx @kanoniv/mcp init

Interactive setup for MCP clients. Generates configuration for Claude Desktop, Cursor, Windsurf, or Claude Code.

bash
$ npx @kanoniv/mcp init

? Select your MCP client: Claude Desktop
? Enter your API key: kn_live_...
? Agent name for this instance: my-coding-agent

Config written to ~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop to connect.

The generated config includes KANONIV_AGENT_NAME so the agent is identified in logs, memory entries, and the agent registry.

API

Knowledge Sync

POST /v1/memory/sync - Bulk upsert memory entries by slug. Idempotent via ON CONFLICT(tenant_id, slug) DO UPDATE.

bash
curl -X POST https://api.kanoniv.com/v1/memory/sync \
  -H "X-API-Key: kn_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "entries": [
      {
        "entry_type": "knowledge",
        "slug": "claude-md",
        "title": "CLAUDE.md",
        "content": "# Project conventions\n\nAlways use TypeScript strict mode..."
      },
      {
        "entry_type": "knowledge",
        "slug": "memory-architecture",
        "title": "Architecture Notes",
        "content": "Rust workspace with 5 crates..."
      }
    ]
  }'
FieldTypeRequiredDescription
entriesarrayYesUp to 200 entries per call
entries[].entry_typestringYesknowledge, decision, investigation, pattern, intent, expertise
entries[].slugstringYesUnique key for upsert
entries[].titlestringYesShort title
entries[].contentstringYesFull content

MCP Tool: sync_knowledge

Agents using the MCP server can sync knowledge programmatically:

json
{
  "tool": "sync_knowledge",
  "arguments": {
    "entries": [
      {
        "entry_type": "knowledge",
        "slug": "project-conventions",
        "title": "Project Conventions",
        "content": "Always use snake_case. Never hardcode API keys."
      }
    ]
  }
}

Workflow: Multi-Agent Project Setup

1. Developer pushes project knowledge

bash
npx @kanoniv/mcp sync

2. Agent A connects (Claude Desktop)

On first connection, Agent A calls search_memory with q="CLAUDE.md" (as instructed by MCP server instructions). Gets the full project context immediately.

3. Agent B connects (Cursor on another machine)

Same API key, same tenant. Agent B gets the same knowledge. Both agents share the same project context without ever communicating directly.

4. Agent A learns something new

Agent A discovers a pattern and stores it via memorize. Agent B gets it on next search_memory call. Knowledge flows through the identity graph.

5. Developer checks the activity stream

bash
npx @kanoniv/mcp log --since 2h

Sees everything both agents did, in chronological order.

Best Practices

  • Sync early, sync often. Run npx @kanoniv/mcp sync after updating CLAUDE.md or memory files. It's idempotent - safe to run repeatedly.
  • Use meaningful slugs. Slugs are the upsert key. claude-md is better than doc-1.
  • Keep knowledge entries focused. One topic per entry. A 50KB CLAUDE.md is fine, but splitting into conventions, architecture, deployment helps agents find what they need.
  • Use --agent filter in logs. When debugging multi-agent issues, filter by agent name to see one agent's activity stream.

The identity and delegation layer for AI agents.