Context LatticeBy Private Memory Corp
Guide 3

Integration Guide

Connect ChatGPT app and Claude chat apps (desktop and web), plus Claude Code, Codex, and OpenClaw/ZeroClaw/IronClaw to Context Lattice once your stack is running locally.

Quick Path

Fastest route to a working integration

  1. Bring the stack up and verify /health and authenticated /status.
  2. Run the write/search smoke test to confirm end-to-end memory behavior.
  3. Bootstrap an agent session, then compile a ranked context packet for the next model call.
  4. Set agent read-call timeout to match retrieval mode (fast: 25s, balanced: 60s, deep: 75s).
  5. Paste the human operator instruction block into your agent session.
  6. Map your client/tooling surface to /memory/write, /memory/search, and /tools/feedback_submit.
  7. Add HTTP/messaging app interfacing (claw-ready) via /integrations/messaging/* endpoints.
  8. For easy monitoring during integration, run gmake monitor-open (or gmake monitor-check).
Version clarity

Integration target for launch

  • Use this for production/public integration: current public v3.17.x lane on http://127.0.0.1:8075.
  • Primary interface: install, adopt, context-pack, checkpoint, and validate through CLI commands first.
  • HTTP/MCP role: use these when an app, local AI workspace, or agent harness needs a programmatic integration surface.
  • Current public retrieval baseline: staged fast-return with async slow-source continuation and Qdrant-first local Lite recall.
Hosted default

Use a dedicated app host for paid runtime and billing operations

Required

Default host split for production is marketing on contextlattice.io and paid app/API on app.contextlattice.io.

  • Marketing/public site: https://contextlattice.io
  • Paid app + dashboard + API: https://app.contextlattice.io
  • Billing infrastructure: managed on the app host via deployment-specific configuration.
  • Wallet/card checkout: unified purchase flow with provider-specific verification handled server-side.
  • Apple Pay + Google Pay: available through Stripe checkout when supported by device/browser.
  • Admin verification controls: restricted to owner/admin authenticated operations.
Prerequisite

Bring stack up first

Required

Use the launch mode you need, then validate core health before integrating any client.

BOOTSTRAP=1 scripts/first_run.sh
ORCH_KEY="$(awk -F= '/^CONTEXTLATTICE_ORCHESTRATOR_API_KEY=/{print substr($0,index($0,"=")+1)}' .env)"

# choose mode if needed
gmake mem-up
# gmake mem-up-lite
# gmake mem-up-full

curl -fsS http://127.0.0.1:8075/health | jq
curl -fsS -H "x-api-key: ${ORCH_KEY}" http://127.0.0.1:8075/status | jq
  • Orchestrator API: http://127.0.0.1:8075
  • MCP hub memory endpoint: http://127.0.0.1:53130/memorymcp/mcp
  • MCP hub qdrant endpoint: optional in full/operator stacks at http://127.0.0.1:53130/qdrant/mcp
Quick wiring

5-minute integration smoke test

Required

Run this once to confirm your app can write and retrieve memory through Context Lattice before wiring UI-specific settings.

ORCH_KEY="$(awk -F= '/^CONTEXTLATTICE_ORCHESTRATOR_API_KEY=/{print substr($0,index($0,"=")+1)}' .env)"

curl -fsS -H "content-type: application/json" -H "x-api-key: ${ORCH_KEY}" \
  -d '{"projectName":"_global","fileName":"smoke/integration_check.md","content":"integration smoke ok"}' \
  http://127.0.0.1:8075/memory/write | jq

curl -fsS -H "content-type: application/json" -H "x-api-key: ${ORCH_KEY}" \
  -d '{"query":"integration smoke ok","limit":3}' \
  http://127.0.0.1:8075/memory/search | jq
  • If both calls return ok: true: your app can safely integrate.
  • If you get 401: verify CONTEXTLATTICE_ORCHESTRATOR_API_KEY and restart the caller process.
Human Operator Guide

Paste this instruction block into your agent chat

Required

Use this as your first message when starting a new ChatGPT/Claude/Codex/Claude Code session so the agent reliably uses Context Lattice.

You must use Context Lattice as the memory/context layer.

Runtime:
- Orchestrator: http://127.0.0.1:8075
- The CLI reads local runtime configuration; do not print secrets.

Required behavior:
1) Before planning, run contextlattice context "<task>" --project <project> --pretty.
2) Continue work with contextlattice resume --project <project> --pretty; never replay raw transcripts.
3) Save durable progress with contextlattice remember "<checkpoint>" --project <project> --pretty.
4) Report retrieval quality with contextlattice correct "<note>" --category useful|wrong|stale|superseded.
5) Finish with contextlattice finish "<verified result>" --success|--repair|--failure.
6) Run contextlattice doctor --pretty when readiness is unclear.
7) Use HTTP only when the CLI is unavailable or you are implementing a harness/app integration.
  • Best practice: include projectName, fileName, and topic path on every write.
  • Timeout guidance: fast reads 25s, balanced reads 60s, deep/slow-source reads 75s.
  • Cache behavior: first deep read may be slow; retrying the same query often returns faster after staged fetch + cache warm.
  • Quality loop: ask user for a short “context quality” rating after key outputs, then write that feedback.
  • Goal: resolve an agentic issue once and persist reusable context for the team/organization.
Profile-aware preflight

Deep integration for Codex, Claude Code, OpenCode, Hermes, OMP, Mercury, ChatGPT, Claude

Required

The CLI resolves the detected profile, stable agent_id, task session, topic scope, and query defaults without making users assemble lifecycle calls.

# prescribed profile-aware workflow
contextlattice doctor --pretty
contextlattice context "release readiness" --project contextlattice --pretty
contextlattice resume --project contextlattice --pretty
contextlattice remember "checkpoint saved" --project contextlattice --pretty
contextlattice finish "release verified" --success --project contextlattice --pretty

# adoption and capability discovery
contextlattice_adopt status --pretty
contextlattice_adopt integrate --repo . --agents codex,claude-code,opencode,hermes-agent,hermes-ultra,omp,mercury-agent,pi,droid --check --pretty
contextlattice_skills_index search "browser automation" --pretty
contextlattice_agent_adapter profiles
  • Profiles supported: codex, claude-code, opencode, hermes-agent, hermes-ultra, omp, mercury-agent, pi, droid, chatgpt-web, chatgpt-desktop, claude-web, claude-desktop.
  • Context compiler: contextlattice context turns current objective state, ranked evidence, missing sources, risks, files, and next action into a bounded agent_packet.v1.
  • Skills Index: contextlattice_skills_index searches active configured skill roots such as $CODEX_HOME/skills without loading every skill body.
  • Template path: docs/public_overview/templates/agents/ (copy-ready prompts and setup blocks).
  • Endpoint remains pinned: http://127.0.0.1:8075.
Messaging Surface

HTTP/messaging app interfacing (claw-ready)

Recommended

Context Lattice now supports channel command intake via orchestrator-native endpoints. The default handle is @ContextLattice.

POST /integrations/messaging/command
POST /integrations/messaging/openclaw
POST /integrations/messaging/ironclaw
POST /integrations/telegram/webhook
POST /integrations/slack/events

@ContextLattice remember deployment complete
@ContextLattice recall deployment
@ContextLattice status
Advanced local command endpoint test
# local direct test (secure default requires x-api-key)
curl -fsS -H "content-type: application/json" -H "x-api-key: ${ORCH_KEY}" \
  -d '{"channel":"openclaw","source_id":"chat-1","text":"@ContextLattice status"}' \
  http://127.0.0.1:8075/integrations/messaging/command | jq
  • BYO accounts: Telegram/Slack credentials stay in your own account.
  • Project routing: commands can include project=<name> and topic=<path> directives.
  • Default behavior: OpenClaw/ZeroClaw route directly; IronClaw is optional and feature-flagged.
Client Integrations

ChatGPT app, Claude chat apps, Claude Code, Codex

Required

ChatGPT apps (desktop + web)

For normal ChatGPT user apps or API-driven GPT clients, use Context Lattice as the memory sidecar and call orchestrator endpoints around message processing.

  • Persist memory on key state changes: POST /memory/write
  • Retrieve context before response generation: POST /memory/search
  • Submit outcome feedback for learning/rerank: POST /tools/feedback_submit
  • Persist browser snapshots for agent-visible pages: POST /memory/browser-context
  • Inspect active runner/tool contracts: GET /ops/capabilities
  • Refresh saved recall evaluation cases from live retrieval pathways: POST /memory/recall/eval-cases/refresh
  • Check runtime health: GET /health and GET /status with x-api-key

Claude chat apps (desktop + web)

Use desktop or browser Claude chat apps through MCP-compatible clients against the local MCP hub endpoint, then route high-value summaries through orchestrator writes.

  • MCP server URL: http://127.0.0.1:53130/memorymcp/mcp
  • Keep write payloads compact; avoid dumping full transcripts.
  • Use topic paths so retrieval stays scoped and fast.

Claude Code + Codex

Point your coding agent runtime at the same local stack and treat memory writes as explicit checkpoints.

export CONTEXTLATTICE_ORCHESTRATOR_URL=http://127.0.0.1:8075
export CONTEXTLATTICE_HTTP_URL=http://127.0.0.1:59081/mcp
export MCP_HUB_URL=http://127.0.0.1:53130/memorymcp/mcp
export CONTEXTLATTICE_ORCHESTRATOR_API_KEY="$(awk -F= '/^CONTEXTLATTICE_ORCHESTRATOR_API_KEY=/{print substr($0,index($0,"=")+1)}' .env)"

Pattern: write summaries after meaningful edits, fetch retrieval context before planning or review actions.

OpenClaw / ZeroClaw / IronClaw

Trait mapping and wiring

Recommended

Map OpenClaw/ZeroClaw/IronClaw memory traits directly to Context Lattice endpoints. Keep orchestrator as the single memory control plane.

Recommended mapping

  • memory_recall_ctxPOST /memory/search
  • memory_save_storePOST /memory/write
  • memory_feedback_submitPOST /tools/feedback_submit
  • messenger command hookPOST /integrations/messaging/openclaw
  • ironclaw command hookPOST /integrations/messaging/ironclaw
  • healthbeatGET /health and GET /status with x-api-key
  • tools_exec → MCP hub /memorymcp/mcp endpoint

Operational defaults

  • Use Qdrant as the public local lite vector default; keep Postgres pgvector first-class for full/operator SQL-co-located vector deployments.
  • Use BYO cloud keys only when explicitly enabled.
  • Preserve orchestrator fanout/backpressure defaults before aggressive tuning.
  • Strict security mode redacts and blocks suspected secrets on OpenClaw/ZeroClaw/IronClaw routes.
Web 3 ready

IronClaw compatibility mode

Advanced
Optional IronClaw compatibility mode

Context Lattice can expose an IronClaw-compatible command surface while keeping local-first orchestration and your existing sink stack unchanged.

# enable IronClaw bridge
IRONCLAW_INTEGRATION_ENABLED=true
IRONCLAW_DEFAULT_PROJECT=messaging

# keep strict secret protections on claw surfaces
MESSAGING_OPENCLAW_STRICT_SECURITY=true
  • Endpoint: POST /integrations/messaging/ironclaw
  • Security: suspected credentials are blocked on write and redacted in returned text/results.
  • Documentation fit: IronClaw's deep docs and ASCII architecture style map cleanly to this mode.