Documentation

Everything you need to get started with Penfield™.

Quick Start

Get up and running with Penfield™ in under 5 minutes.

  1. Create an account at portal.penfield.app
  2. Generate an API key from the API Keys page
  3. Exchange your API key for a JWT token (see below)
  4. Start making API calls or set up MCP

MCP Setup

Penfield™ works with any AI that supports MCP.

  1. Open Settings → Connectors
  2. Click Add custom connector
  3. Connector name: Penfield
  4. Remote MCP server URL: https://mcp.penfield.app
  5. Sign in with your Penfield™ account when prompted
Recommended: Native connectors work on Desktop, Mobile, and Web — no extra tooling required.

Run this command in your terminal:

claude mcp add --transport streamable-http --scope user penfield https://mcp.penfield.app
Note: Claude Code connects directly over HTTP — no proxy or mcp-remote needed.

Available Tools

ToolDescription
storeSave a memory with type, tags, and importance
recallHybrid search for relevant memories and documents
searchSearch with filters (tags, dates, source type)
connectLink memories with typed relationships
exploreTraverse the knowledge graph from a memory
reflectAnalyze recent memory patterns and topics
save_contextSave cognitive state for agent handoffs
restore_contextResume from a saved context checkpoint

API Reference

Base URL: https://api.penfield.app/api/v2

All endpoints require a valid JWT token in the Authorization header.

Authentication

The API uses a two-step authentication flow. First, exchange your API key for a JWT token (valid 24 hours), then use the token for all subsequent requests.

EndpointDescription
POST/auth/token Exchange API key for JWT token (24h validity)

Step 1 — Exchange API Key for JWT

curl -X POST https://api.penfield.app/api/v2/auth/token \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
// Response { "status": "success", "data": { "access_token": "eyJhbGc...", "token_type": "bearer", "expires_in": 86400 } }

Step 2 — Use JWT for API Calls

curl -X GET https://api.penfield.app/api/v2/memories \ -H "Authorization: Bearer $JWT"
Important: Do not include trailing slashes on endpoints. Use /memories not /memories/.

Memories

Create, retrieve, update, and delete memories. Memories are automatically embedded for semantic search.

EndpointDescription
POST/memories Create a new memory
GET/memories List memories (paginated)
GET/memories/{id} Get a specific memory
PUT/memories/{id} Update a memory
DELETE/memories/{id} Delete a memory
POST/memories/{id}/connect Connect two memories with a typed relationship

Create a Memory

curl -X POST https://api.penfield.app/api/v2/memories \ -H "Authorization: Bearer $JWT" \ -H "Content-Type: application/json" \ -d '{ "content": "The project uses PostgreSQL with pgvector", "memory_type": "fact", "tags": ["technical", "database"], "importance": 0.8 }'

Memory types: fact, insight, hypothesis, question, answer, correction, strategy

Documents

Upload documents to make them searchable. Documents are automatically chunked, embedded, and indexed.

EndpointDescription
POST/documents/upload Upload a document (multipart form)
GET/documents List documents
GET/documents/{id} Get document metadata
GET/documents/{id}/download Download original document
DELETE/documents/{id} Delete document and chunks

Upload a Document

curl -X POST https://api.penfield.app/api/v2/documents/upload \ -H "Authorization: Bearer $JWT" \ -F "file=@my-document.pdf"

Supported formats: PDF, TXT, Markdown, and other text-based files.

Need Help?

Have questions or need support? Email us at support@penfield.app. Paid plans include priority support with faster response times.