Personal Context Protocol

User Guide

  • Personal Context Protocol
    • Runtime Shape
    • Workflow
    • Invariants
    • Deploy
    • References
  • Deployment: Vercel + Neon
    • Requirements
    • Deploy
    • Zero-Config Admin Login
    • Reset Admin Token With Env
    • Admin token recovery
      • I entered the wrong password / lost the token
    • Docker Compose Alternative
    • Local Development
    • Verify
    • Troubleshooting
  • AI Agent Instructions
    • Discover the upload routes
    • Allowed
    • Not Allowed
    • Record messages
    • Record a compaction
    • Canonical fallback block
    • Forgiving ingest (fallback)
    • Errors

API Reference

  • API Reference
    • Error Shape
    • Public And Setup
      • GET /health
      • GET /setup/status
      • POST /setup/init
      • GET /auth/check
      • PATCH /auth/token
    • Admin Topics
      • GET /topics
      • POST /topics
      • POST /topics/:id/rename
      • POST /topics/:id/archive
      • DELETE /topics/:id
      • DELETE /sessions/:id
      • POST /trash/empty
    • Admin Sessions
      • GET /sessions
      • POST /sessions
      • GET /topics/:topicId/sessions
      • POST /topics/:topicId/sessions
      • GET /sessions/:id
      • PATCH /sessions/:id
      • POST /sessions/:id/import
      • GET /sessions/:id/review
      • PATCH /sessions/:id/messages/:messageId
      • POST /sessions/:id/messages/delete
      • GET /sessions/:id/events
      • GET /sessions/:id/compactions
      • POST /sessions/:id/archive
    • Tokens
      • GET /sessions/:sessionId/tokens
      • DELETE /sessions/:sessionId/tokens
      • PATCH /sessions/:sessionId/tokens
      • POST /sessions/:sessionId/tokens
    • Agent Recording (URL + token)
      • GET /r/:sessionId (public)
      • GET /api/v1/agent/resolve?url=<recording-url> (public)
      • GET /api/v1/agent/sessions/:sessionId/protocol (public)
      • POST /api/v1/agent/sessions/:sessionId/messages
      • POST /api/v1/agent/sessions/:sessionId/compact
      • POST /api/v1/agent/sessions/:sessionId/ingest
      • GET /api/v1/agent/sessions/:sessionId/review
    • AI Message Append (legacy)
      • POST /sessions/:sessionId/messages
    • Public
      • GET /public/sessions/:id (public)
    • Agent Schemas (public)
      • GET /agent/schema/message
      • GET /agent/schema/compact
      • GET /agent/schema/ingest
    • Recording URL origin
    • Export
      • GET /export
  • PCP Data Model
    • Overview
    • Design principles
    • Tables
      • app_instance
      • ui_auth
      • topics
      • sessions
      • session_tokens
      • messages
      • compactions
      • events
      • schema_migrations
    • ID format
    • Relationships
    • Indexes
      • Performance-critical indexes
      • Composite indexes
    • Migrations
    • Security considerations
      • Token storage
      • Message content
      • Access control
    • Example queries
      • Get all messages for a session (chronological)
      • Get session with topic info (admin view)
      • Validate session token
      • Get recent events
    • Version history
      • v0.1.0 (initial)
      • v0.1.3 (agent recording URL)
      • v0.1.4 (admin token rotation)
      • v0.1.5 (uncategorized sessions)
      • v0.1.6 (token rotation default fix)
      • v0.1.7 (public sharing + token revocation)
      • v0.1.8 (human fallback import)
      • v0.1.9 (recording modes + token rename)
      • v0.1.10 (message correction)
      • v0.1.15 (compaction rendering + mixed ingest + hardening)
  • Export Format
  • Logging Guidelines (PCP)
    • Overview
    • Usage
    • Log Levels
    • File Structure
    • Formatting
    • Secrets
    • Long-running operations
    • Notifications
  • PCP Migrations Guide
    • Overview
    • Migration structure
    • Generating migrations
    • Applying migrations
      • Automatic (recommended)
      • Manual
      • Local development
    • Migration principles
      • 1. No destructive changes
      • 2. Preserve data
      • 3. Idempotent where possible
      • 4. Test migrations
    • Current migrations
      • 0000_initial
      • 0001_agent_recording
      • 0002_admin_token_source
      • 0003_optional_topic
      • 0004_default_token_rotates
      • 0005_public_session
      • 0006_session_mode
    • Checking migration status
    • Rollback (if needed)
    • Version tracking

Security

  • Security Model
    • Token Rules
    • AI Boundaries
    • Message Records
    • Audit Events
    • Secrets
    • Diagnostics
  • Current Limits

Agent Guidelines

  • PCP Project-Specific Agent Rules
    • Project context
    • Critical invariants
      • AI must NOT manage topics
      • Messages are append-only for AI
      • Token scoping
      • No external auth in v0.1
    • Development rules
      • Verify before claiming
      • No unrelated refactors
      • File size discipline
      • Error messages
      • Git discipline
    • Testing requirements
      • Required tests for PR
      • Test commands
    • Documentation updates
    • Common pitfalls to avoid
      • Pitfall 1: Accidentally exposing topic fields to AI
      • Pitfall 2: Allowing message updates
      • Pitfall 3: Token leakage in logs
      • Pitfall 4: Breaking migrations
    • File locations
    • Questions to ask the user
  • End-of-round checklist
    • Common mistakes seen in this project
    • Round-end checklist
      • Verification
      • Docs audit
      • Security audit
      • Git hygiene
    • Current round log
  • TODO
    • v0.1 Completed
    • v0.1.3 Completed — Agent recording URL
    • v0.1.4–v0.1.10 Completed — Operability & correction
    • v0.1 Remaining Hardening
    • v0.2 Protocol Features
    • v0.3 Operations
    • Later Candidates
    • Status Legend
Personal Context Protocol
  • Search


© Copyright 2026, Nesbitt-bot.

Built with Sphinx using a theme provided by Read the Docs.