Skip to main content
Persistent cross-session memory for Claude Code. Connect the PiyAPI plugin to your Claude Code environment to persist relevant bitemporal context across sessions and retrieve it on demand.
Current plugin version: v1.2.0

Prerequisites

1

PiyAPI API key

Required for authentication. Export this as PIYAPI_API_KEY.
2

Supported agent environment

The Claude Code CLI must be installed and accessible on your $PATH.
3

Runtime dependencies

Node.js 18+ and the piyapi-cli.

Quick Start

To install the plugin, bind it to your Claude Code session, and confirm the connection:
Setup Flow: 1. Install -> 2. Configure -> 3. Restart agent -> 4. Verify

Managing the Plugin

Use the CLI to manage the plugin lifecycle:

What You Can Do

  • Automatic memory: Captures relevant context from coding sessions in the background.
  • Commands: Exposes explicit CLI commands for searching, checking status, forgetting, and pausing/resuming memory capture.
  • Search tool: Query previous sessions and retrieve relevant context on demand via the UnifiedScorer.
  • Sidekick agent: Spin up an isolated investigation or implementation workflow while preserving the primary working context.

Commands

Search Tool

Use the search tool to query prior sessions and retrieve context bounded by relevance and scope.

Sidekick Agent

The sidekick agent handles isolated investigation or implementation work in a separate context, then returns its findings to the main agent without polluting the primary working memory. Workflow: Main Agent -> Sidekick -> Investigation -> Result -> Main Agent

How It Works

1

Capture

Records relevant activity from the agent session.
2

Flush

Sends captured context to the PiyAPI engine after meaningful interaction boundaries.
3

Extract

Parses useful project context, architectural decisions, constraints, and preferences.
4

Recall

Retrieves relevant bitemporal memories during subsequent sessions.
Architecture flow:

Memory Scoping

Memory is strictly scoped between shared project context and personal context. Relevant overlap is surfaced dynamically during retrieval via Context Assembly. Data flow:

Search Scope

Example: Setting scope to dir restricts retrieval strictly to memories captured within the current working directory.

Settings

Configure the plugin via environment variables:

Upgrading

Before upgrading to a new plugin version, verify the following checklist to avoid breaking your existing configuration or memory behavior:
  • Review changed configuration keys
  • Check command deprecations/changes
  • Verify memory compatibility
  • Re-run plugin setup
  • Confirm agent compatibility

Troubleshooting

Telemetry

What may be collected:
  • Event type
  • Plugin version
  • Runtime information
  • Basic performance and error metadata
Document the exact telemetry behavior here before production release.

PiyAPI MCP

Connect PiyAPI memory through MCP-compatible workflows.

Codex Integration

Add persistent context to supported Codex workflows.

Cursor

Persistent memory for Cursor.

OpenCode

Context-aware OpenCode workflows.

Gemini CLI

Memory for Gemini CLI agents.

Cline

Persistent context for Cline.
Building with PiyAPI? Explore the open-source stack, contribute integrations, or browse the developer community.