Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: versions
attributes:
label: Environment
description: Include the package, Pi, Node.js, operating system, and model versions, and your `contextKit` and `compaction` settings.
description: Include the package, Pi, Node.js, operating system, and model versions, your `context-kit.json` files, and your `compaction` settings.
validations:
required: true
- type: textarea
Expand Down
418 changes: 98 additions & 320 deletions README.md

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions context-kit.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://unpkg.com/pi-context-kit/context-kit.schema.json",
"title": "pi-context-kit settings",
"description": "~/.pi/agent/context-kit.json, or .pi/context-kit.json in a trusted project.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"enabled": {
"description": "false stops context maintenance and handoff notes. recall stays available.",
"type": "boolean",
"default": true
},
"threshold": {
"description": "Where maintenance starts: a number of tokens, a share of the context window such as \"75%\", or \"pi\" for Pi's own compaction threshold.",
"default": "75%",
"oneOf": [
{ "type": "integer", "minimum": 1 },
{ "type": "string", "pattern": "^(0*100(\\.0+)?|0*[1-9]\\d?(\\.\\d+)?|0+\\.\\d*[1-9]\\d*)%$" },
{ "const": "pi" }
]
},
"strategy": {
"description": "balanced: handoff note written in the background, then shake, then Pi's summary. frugal: shake first, no background calls. pi-summary: Pi's summary only.",
"enum": ["balanced", "frugal", "pi-summary"],
"default": "balanced"
},
"advanced": {
"type": "object",
"additionalProperties": false,
"properties": {
"methodOrder": {
"description": "Replaces the method order of the strategy. Methods after \"soft\" never run.",
"type": "array",
"items": { "enum": ["handoff", "shake", "soft"] }
},
"background": {
"description": "Write the handoff note in the background before the threshold. The strategy sets the default.",
"type": "boolean"
},
"supersedeReads": {
"description": "Replace an older read of a file that was read again.",
"type": "boolean",
"default": true
},
"progressRatio": {
"description": "Each method must bring the context to this fraction of the threshold, or the next method runs.",
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1,
"default": 0.8
},
"prune": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": { "type": "boolean", "default": true },
"protectTokens": {
"description": "The newest tool outputs, up to this many tokens, are never pruned.",
"type": "integer",
"minimum": 0,
"default": 40000
},
"minSavings": {
"description": "Prune only when this many tokens or more are removed.",
"type": "integer",
"minimum": 0,
"default": 20000
},
"minTokens": {
"description": "Tool outputs smaller than this are never pruned.",
"type": "integer",
"minimum": 0,
"default": 50
}
}
},
"shake": {
"type": "object",
"additionalProperties": false,
"properties": {
"protectTokens": {
"description": "The newest context, up to this many tokens, is never shaken.",
"type": "integer",
"minimum": 0,
"default": 16000
},
"minSavings": {
"description": "Shake only when this many tokens or more are removed.",
"type": "integer",
"minimum": 0,
"default": 4000
},
"blockMinTokens": {
"description": "Code and XML blocks smaller than this are never shaken.",
"type": "integer",
"minimum": 0,
"default": 400
}
}
}
}
}
}
}
Loading
Loading