Manage, retrieve, and compact AI project instructions, lessons learned, and contextual rules for LLM workflows.
Project description
Contextile
Contextile is a Python toolkit for managing, retrieving, and compacting AI project instructions, lessons learned, and contextual rules for LLM workflows.
The MVP focuses on a small local workflow:
- initialize a
.contextile/workspace; - store durable lessons in JSONL;
- validate lesson records;
- search relevant lessons for a task;
- build a compact Markdown context block for an LLM.
MCP support is planned as a thin optional layer on top of the core library.
Install locally
pip install -e .
Initialize a project
contextile init
This creates:
.contextile/
config.json
lessons.jsonl
instructions/
project-context.md
architecture-rules.md
code-standards.md
validation.md
Add a lesson
contextile add-lesson \
--id preserve-domain-terms \
--when "Editing existing domain terms in code, docs, routes, schemas, enums, or API contracts." \
--do "Preserve domain terms exactly as used in the project." \
--avoid "Do not translate established domain terms." \
--scope "Code, docs, API, DB, routes, enums, UI." \
--tags domain,terminology,api,routes,enums
Search lessons
contextile search "api validation reports" --limit 5
Build compact context
contextile build-context \
--task "Refactor API validation for reports" \
--file src/schemas/par/relatorio.py \
--tag api \
--tag validation \
--max-tokens 800
Validate records
contextile validate
Compact records
contextile compact
Lesson JSONL schema
Each line in .contextile/lessons.jsonl is one lesson:
{"id":"preserve-domain-terms","when":"Editing existing domain terms.","do":"Preserve terms exactly as used.","avoid":"Do not translate established terms.","scope":"Code, docs, API, DB, routes, enums, UI.","tags":["domain","terms","api"]}
Required fields:
idwhendoavoid
Recommended fields:
scopetagswhyupdated_at
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contextile-0.1.0.tar.gz.
File metadata
- Download URL: contextile-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee0a1c263872090ebcb2d8a6f08cbae50785852584f1430b6eab361b5811ae86
|
|
| MD5 |
e80fb653ef8098bf0021b7cce7e1f0ed
|
|
| BLAKE2b-256 |
060aa5e908722314694ddf5f70234f54438faab803e77041385d136ddff1966f
|
File details
Details for the file contextile-0.1.0-py3-none-any.whl.
File metadata
- Download URL: contextile-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a69c513bff0b0c01c7e7a125aeeb7eb332824cbff8b666df6264b85ec84f01c8
|
|
| MD5 |
cc8afac8326607ff096f888fd762a903
|
|
| BLAKE2b-256 |
d2a268da51f7bd5767353bda6ef70100c17fa3dec3ad83a10b48307132d6e4c6
|