Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.
The context layer is the knowledge your lineage, the in-app
assistant, and any connected LLM read. px lets you keep it as files in your repo and
sync it with px context apply — without migrating your existing docs.
The model: manifests point at pristine bodies
The only Prometheux-aware artifact is a context-set manifest — a *.context.md file
that carries the config and references plain body files. The bodies stay untouched, so
you can point at docs you already have (a wiki, a docs/ tree, playbooks).
context/ market.context.md # a context set: config + references playbooks.context.mdfacts/ # pristine bodies — no frontmatter, reusable, could be your existing docs market-segments.md market-trends.md
A manifest:
# context/market.context.md---scope: global # global | project (declared here, not inferred from the folder)activation: always # retrieved | always | on_demandkind: factnotes: - facts/market-segments.md - facts/market-trends.md - path: facts/market-forecast.md activation: on_demand # per-entry override of the set defaultlinks: - from: facts/market-segments.md to: concept:credit_risk_score relation: relates_to---Optional prose for the human reader; ignored by import.
Fields
Field
Values
Meaning
scope
global | project
global is exposed to every ontology; project belongs to a single ontology. (The scope value stays project — it is the platform’s wire name.) Declared in the manifest, not inferred from the folder.
activation
retrieved | always | on_demand
How the note is served (below).
kind
e.g. fact, rule
Default kind for the set. type: rule is sugar for activation: always.
notes
list of body paths
The body files this set publishes (one note each). Per-entry overrides allowed.
links
list
Authored edges (below).
Activation behaviours
retrieved (default) — the note lives in the semantic pool and is looked up only
when a request is relevant. Costs nothing when unused.
always — a rule: injected verbatim into the assistant’s instructions on every
request. Strongest guarantee, but costs tokens every message.
on_demand — only the title is listed each request; the assistant fetches the body
when it decides it needs it. Good for long playbooks.
Links
Declared in the manifest, so bodies stay pristine. Relations: relates_to, defines,
example_of, contradicts. Link a note to a lineage concept with
to: concept:<predicate>.
derived_from provenance edges are platform-owned (emitted by context-concept runs) —
never author them.
Applying context
px context apply # create/update notes + links from every *.context.mdpx context apply --prune # also delete notes dropped from the manifests
context apply is idempotent: a small CLI-owned state file
(.px/context-state.json) maps each note’s identity (manifest, referenced path) to its
server note id + a content hash, so re-applying updates changed notes, skips unchanged
ones, and (with --prune) removes notes you dropped.
Commit .px/context-state.json so re-apply stays idempotent across machines and CI. If
it’s lost, context apply reconciles against the server’s existing notes by content so
notes aren’t duplicated.
Duplicates are allowed
Identity is the manifest reference, not the body path — so the same body listed in two
sets becomes two notes, each with its own scope/activation. px never merges or
dedupes; the plan surfaces duplicates so they’re visible, but leaves them to you.
Sync model — one-way, files win
The manifests + bodies in your repo are the source of truth; the platform holds a
retrieval/embedding replica. A set under git sync is git-owned (in-app edits to its notes
are locked/flagged, like ArgoCD owning a namespace). Context not under git stays in-app
editable. There is no merge logic.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Prometheux","colors":{"primary":"#4a90fd","light":"#40e9a0","dark":"#0f0f0f"},"logo":{"light":"/images/202510-Logo-TransparentBlack.jpg","dark":"/images/202510-Logo-White.png","href":"https://prometheux.ai"},"favicon":{"light":"/images/prometheux_icon_black_on_white.jpg","dark":"/images/prometheux_icon_black_on_white.jpg"},"background":{"color":{"light":"#ffffff","dark":"#0f0f0f"}},"navbar":{"links":[{"href":"https://platform.prometheux.ai","label":"Platform"}],"primary":{"type":"button","label":"Get Started","href":"https://platform.prometheux.ai/login"}},"footer":{"socials":{"website":"https://prometheux.ai","linkedin":"https://www.linkedin.com/company/prometheux"}},"fonts":{"family":"Roboto","weight":400},"integrations":{"telemetry":{"enabled":false}},"navigation":{"global":{"anchors":[{"anchor":"Community (Coming Soon)","icon":"discord","color":{"light":"#ffee16","dark":"#ffee16"},"href":"https://docs.prometheux.ai/resources/community"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4127"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":true,"isLoggedInCli":false,"mintExport":{}},"customCss":[{"filePath":"assets/static-search.css","content":"#px-search-modal{position:fixed;inset:0;display:none;z-index:9999}#px-search-modal.open{display:block}.px-search-backdrop{position:absolute;inset:0;background:rgba(15, 15, 15, 0.55);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}.px-search-panel{position:relative;display:flex;flex-direction:column;width:min(680px, calc(100vw - 32px));max-height:82vh;max-height:82dvh;margin:9vh auto 0;background:#ffffff;color:inherit;border-radius:14px;box-shadow:0 16px 48px rgba(0, 0, 0, 0.35);overflow:hidden;padding:18px 18px 12px}html.dark .px-search-panel,html[data-theme=\"dark\"] .px-search-panel{background:#141414;color:#e8e8e8}html.px-search-open,html.px-search-open body{overflow:hidden}:root{--px-search-primary: #00e382}.pagefind-ui{--pagefind-ui-primary: var(--px-search-primary);--pagefind-ui-text: #1a1a1a;--pagefind-ui-background: transparent;--pagefind-ui-border: #e3e3e3;--pagefind-ui-tag: #f4f4f4;--pagefind-ui-border-width: 1px;--pagefind-ui-border-radius: 10px;--pagefind-ui-image-border-radius: 8px;--pagefind-ui-image-box-ratio: 3 / 2;--pagefind-ui-font: inherit;--pagefind-ui-scale: 0.95}html.dark .pagefind-ui,html[data-theme=\"dark\"] .pagefind-ui{--pagefind-ui-text: #ececec;--pagefind-ui-border: #2a2a2a;--pagefind-ui-tag: #1f1f1f}.pagefind-ui__search-input{font-size:1rem}.pagefind-ui__result-link{color:var(--px-search-primary)}#px-search-modal #px-search-host,#px-search-modal .pagefind-ui,#px-search-modal .pagefind-ui__form{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}#px-search-modal .pagefind-ui__search-input{flex:0 0 auto}#px-search-modal .pagefind-ui__drawer{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}"}],"page":{"pagePath":"integrations/cli/context-as-code","slug":"/integrations/cli/context-as-code","pageMetadata":{"title":"Context as code","description":"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.","href":"/integrations/cli/context-as-code"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/platform/ai-assistant`,children:`context layer`}),` is the knowledge your lineage, the in-app\nassistant, and any connected LLM read. `,_jsx(_components.code,{children:`px`}),` lets you keep it as files in your repo and\nsync it with `,_jsx(_components.code,{children:`px context apply`}),` — without migrating your existing docs.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-model-manifests-point-at-pristine-bodies`,children:`The model: manifests point at pristine bodies`}),`\n`,_jsxs(_components.p,{children:[`The only Prometheux-aware artifact is a `,_jsx(_components.strong,{children:`context-set manifest`}),` — a `,_jsx(_components.code,{children:`*.context.md`}),` file\nthat carries the config and `,_jsx(_components.em,{children:`references`}),` plain body files. The bodies stay untouched, so\nyou can point at docs you already have (a wiki, a `,_jsx(_components.code,{children:`docs/`}),` tree, playbooks).`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`context/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` market.context.md # a context set: config + references`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` playbooks.context.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`facts/ # pristine bodies — no frontmatter, reusable, could be your existing docs`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` market-segments.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` market-trends.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`A manifest:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`16`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# context/market.context.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`scope`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`global`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # global | project (declared here, not inferred from the folder)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`activation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`always`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # retrieved | always | on_demand`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`kind`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`fact`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`notes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`facts/market-segments.md`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`facts/market-trends.md`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`facts/market-forecast.md`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` activation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`on_demand`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # per-entry override of the set default`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`links`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`facts/market-segments.md`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` to`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`concept:credit_risk_score`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` relation`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`relates_to`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`---`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Optional prose for the human reader; ignored by import.`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`fields`,children:`Fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Values`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`scope`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`global`}),` | `,_jsx(_components.code,{children:`project`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`global`}),` is exposed to every ontology; `,_jsx(_components.code,{children:`project`}),` belongs to a single ontology. (The scope value stays `,_jsx(_components.code,{children:`project`}),` — it is the platform’s wire name.) Declared in the manifest, `,_jsx(_components.strong,{children:`not`}),` inferred from the folder.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`activation`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`retrieved`}),` | `,_jsx(_components.code,{children:`always`}),` | `,_jsx(_components.code,{children:`on_demand`})]}),_jsx(_components.td,{children:`How the note is served (below).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kind`})}),_jsxs(_components.td,{children:[`e.g. `,_jsx(_components.code,{children:`fact`}),`, `,_jsx(_components.code,{children:`rule`})]}),_jsxs(_components.td,{children:[`Default kind for the set. `,_jsx(_components.code,{children:`type: rule`}),` is sugar for `,_jsx(_components.code,{children:`activation: always`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`notes`})}),_jsx(_components.td,{children:`list of body paths`}),_jsx(_components.td,{children:`The body files this set publishes (one note each). Per-entry overrides allowed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`links`})}),_jsx(_components.td,{children:`list`}),_jsx(_components.td,{children:`Authored edges (below).`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`activation-behaviours`,children:`Activation behaviours`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`retrieved`})}),` (default) — the note lives in the semantic pool and is looked up only\nwhen a request is relevant. Costs nothing when unused.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`always`})}),` — a `,_jsx(_components.strong,{children:`rule`}),`: injected verbatim into the assistant’s instructions on every\nrequest. Strongest guarantee, but costs tokens every message.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`on_demand`})}),` — only the title is listed each request; the assistant fetches the body\nwhen it decides it needs it. Good for long playbooks.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`links`,children:`Links`}),`\n`,_jsxs(_components.p,{children:[`Declared in the manifest, so bodies stay pristine. Relations: `,_jsx(_components.code,{children:`relates_to`}),`, `,_jsx(_components.code,{children:`defines`}),`,\n`,_jsx(_components.code,{children:`example_of`}),`, `,_jsx(_components.code,{children:`contradicts`}),`. Link a note to a lineage concept with\n`,_jsx(_components.code,{children:`to: concept:\u003cpredicate>`}),`.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`derived_from`}),` provenance edges are platform-owned (emitted by context-concept runs) —\nnever author them.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`applying-context`,children:`Applying context`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`px`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` context`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apply`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # create/update notes + links from every *.context.md`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`px`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` context`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apply`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --prune`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # also delete notes dropped from the manifests`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`context apply`}),` is `,_jsx(_components.strong,{children:`idempotent`}),`: a small CLI-owned state file\n(`,_jsx(_components.code,{children:`.px/context-state.json`}),`) maps each note’s identity `,_jsx(_components.code,{children:`(manifest, referenced path)`}),` to its\nserver note id + a content hash, so re-applying updates changed notes, skips unchanged\nones, and (with `,_jsx(_components.code,{children:`--prune`}),`) removes notes you dropped.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Commit `,_jsx(_components.code,{children:`.px/context-state.json`}),` so re-apply stays idempotent across machines and CI. If\nit’s lost, `,_jsx(_components.code,{children:`context apply`}),` reconciles against the server’s existing notes by content so\nnotes aren’t duplicated.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`duplicates-are-allowed`,children:`Duplicates are allowed`}),`\n`,_jsxs(_components.p,{children:[`Identity is the manifest reference, not the body path — so the `,_jsx(_components.strong,{children:`same body listed in two\nsets becomes two notes`}),`, each with its own scope/activation. `,_jsx(_components.code,{children:`px`}),` never merges or\ndedupes; the plan `,_jsx(_components.em,{children:`surfaces`}),` duplicates so they’re visible, but leaves them to you.`]}),`\n`,_jsx(Heading,{level:`2`,id:`sync-model-—-one-way-files-win`,children:`Sync model — one-way, files win`}),`\n`,_jsx(_components.p,{children:`The manifests + bodies in your repo are the source of truth; the platform holds a\nretrieval/embedding replica. A set under git sync is git-owned (in-app edits to its notes\nare locked/flagged, like ArgoCD owning a namespace). Context not under git stays in-app\neditable. There is no merge logic.`}),`\n`,_jsx(Heading,{level:`2`,id:`sync-from-ci`,children:`Sync from CI`}),`\n`,_jsx(CodeBlock,{numberOfLines:`15`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# .github/workflows/prometheux-context.yml`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Sync context to Prometheux`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` branches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` sync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runs-on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ubuntu-latest`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` steps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/checkout@v4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pipx install prometheux`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`px context apply --prune -y`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` JARVISPY_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.JARVISPY_URL }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PMTX_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PMTX_TOKEN }}\"})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/integrations/cli/ci-cd`,children:`CI/CD`}),` for applying lineage the same way.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Context as code","description":"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.","href":"/integrations/cli/context-as-code"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The model: manifests point at pristine bodies","slug":"the-model-manifests-point-at-pristine-bodies","depth":2,"children":[]},{"title":"Fields","slug":"fields","depth":2,"children":[{"title":"Activation behaviours","slug":"activation-behaviours","depth":3,"children":[]},{"title":"Links","slug":"links","depth":3,"children":[]}]},{"title":"Applying context","slug":"applying-context","depth":2,"children":[]},{"title":"Duplicates are allowed","slug":"duplicates-are-allowed","depth":2,"children":[]},{"title":"Sync model — one-way, files win","slug":"sync-model-—-one-way-files-win","depth":2,"children":[]},{"title":"Sync from CI","slug":"sync-from-ci","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/localhost/59112c55929f7b0a/assets/static-search.js"],"subdomain":"localhost","siteName":"Prometheux","title":"Context as code - Prometheux","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"integrations/cli/context-as-code.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Prometheux\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"Context as code - Prometheux\">\u003cmeta data-mint-head property=\"og:description\" content=\"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Prometheux\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./integrations/cli/context-as-code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Context as code - Prometheux\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Keep the context layer — the knowledge notes your AI assistant reads — as files in your repo, and sync them idempotently with px context apply.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Prometheux\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4a90fd\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./integrations/cli/context-as-code\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/cli/context-as-code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Prometheux\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Prometheux\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integrations/cli/context-as-code.md","siteName":"Prometheux","nav":{"global":{"anchors":[{"anchor":"Community (Coming Soon)","icon":"discord","color":{"light":"#ffee16","dark":"#ffee16"},"href":"https://docs.prometheux.ai/resources/community"}]},"groups":[{"group":"Introduction","pages":[{"title":"Getting Started","href":"/introduction"}]},{"group":"Get Started","pages":[{"title":"Platform Overview","href":"/get-started/platform-overview"},{"title":"Quickstart","href":"/get-started/quickstart"},{"title":"Your First Ontology","href":"/get-started/your-first-ontology"},{"group":"Installation","pages":[{"title":"Installation","href":"/get-started/installation/overview"},{"title":"Prometheux Cloud","href":"/get-started/installation/cloud"},{"title":"Snowflake Native App","href":"/get-started/installation/snowflake"},{"group":"On-Premises","pages":[{"title":"On (Cloud) Premises","href":"/get-started/installation/on-premises/cloud-premises"},{"title":"Single VM","href":"/get-started/installation/on-premises/single-vm"},{"title":"Physical Premises","href":"/get-started/installation/on-premises/physical-premises"}]},{"group":"Databricks","pages":[{"title":"Databricks","href":"/get-started/installation/databricks/overview"},{"title":"Databricks Native App","href":"/get-started/installation/databricks/native-app"},{"title":"Installing PX on Databricks \u0026 Connectors","href":"/get-started/installation/databricks/connectors"}]},{"title":"Palantir Foundry","href":"/get-started/installation/palantir"}]}]},{"group":"Platform","pages":[{"title":"Data Connections","href":"/platform/data-connections"},{"title":"Ontologies","href":"/platform/ontologies"},{"title":"Ontology Graph","href":"/platform/ontology-graph"},{"title":"Concepts \u0026 Lineage","href":"/platform/concepts-and-lineage"},{"title":"Ontology Workspace","href":"/platform/ontology-workspace"},{"title":"Concept Editor","href":"/platform/concept-editor"},{"title":"Context \u0026 LLM Concepts","href":"/platform/context-and-llm-concepts"},{"group":"Apps","pages":[{"title":"Apps","href":"/platform/apps/overview"},{"title":"Your first app","href":"/platform/apps/your-first-app"},{"title":"Forms and parameters","href":"/platform/apps/forms-and-parameters"},{"title":"Selects, triggers and drill-downs","href":"/platform/apps/selects-triggers-and-drill-downs"},{"title":"The App Editor","href":"/platform/apps/the-app-editor"},{"title":"How apps run","href":"/platform/apps/how-apps-run"},{"title":"App definition reference","href":"/platform/apps/schema-reference"}]},{"title":"AI Assistant","href":"/platform/ai-assistant"},{"title":"Compute","href":"/platform/compute"},{"title":"Settings","href":"/platform/settings"}]},{"group":"Integrations","pages":[{"title":"PX APIs","href":"/integrations/overview"},{"title":"Python SDK","href":"/integrations/python-sdk"},{"title":"TypeScript SDK","href":"/integrations/typescript-sdk"},{"title":"SDK Function Reference","href":"/integrations/sdk-reference"},{"title":"REST API","href":"/integrations/rest-api"},{"title":"Config","href":"/integrations/config"},{"title":"Bring Your Own Frontend","href":"/integrations/bring-your-own-frontend"},{"title":"Chat API","href":"/integrations/chat-api"},{"group":"CLI","pages":[{"title":"Overview","href":"/integrations/cli/overview"},{"title":"Installation","href":"/integrations/cli/installation"},{"title":"Quickstart","href":"/integrations/cli/quickstart"},{"title":"Authoring a workspace","description":"The px file model: workspace and ontology manifests, the six concept kinds, datasources, and the derived lineage graph.","href":"/integrations/cli/authoring"},{"title":"Context as code","href":"/integrations/cli/context-as-code"},{"title":"Command reference","description":"Every px command and flag: init, validate, login, pull, list, plan, apply, run, show, query, test, search, status, snapshot, policy, template, datasource, app, context, playbook, compute, delete, skill.","href":"/integrations/cli/command-reference"},{"title":"Agent skill","href":"/integrations/cli/agent-skill"},{"title":"CI/CD","href":"/integrations/cli/ci-cd"}]},{"group":"MCP","pages":[{"title":"AI Agent Integration via MCP","href":"/integrations/mcp/overview"},{"title":"Local MCP Server","href":"/integrations/mcp/local"},{"title":"Remote MCP Server","href":"/integrations/mcp/remote"},{"title":"Connect Claude","href":"/integrations/mcp/claude"},{"title":"Connect Claude Code","href":"/integrations/mcp/claude-code"},{"title":"Connect ChatGPT","href":"/integrations/mcp/chatgpt"},{"title":"Connect Cursor","href":"/integrations/mcp/cursor"},{"title":"Connect Genie Code","href":"/integrations/mcp/databricks-genie"},{"title":"Connect Snowflake Cortex","href":"/integrations/mcp/snowflake-cortex"}]},{"group":"API Reference","pages":[{"title":"Authentication","href":"/integrations/api-endpoints/authentication"},{"title":"Ontologies","href":"/integrations/api-endpoints/ontologies"},{"title":"Ontology Sharing","href":"/integrations/api-endpoints/sharing"},{"title":"Concepts","href":"/integrations/api-endpoints/concepts"},{"title":"Data Sources","href":"/integrations/api-endpoints/data"},{"title":"Schema","href":"/integrations/api-endpoints/schema"},{"title":"Knowledge Graph","href":"/integrations/api-endpoints/knowledge-graph"},{"title":"Vadalog","href":"/integrations/api-endpoints/vadalog"},{"title":"Vadalingo","href":"/integrations/api-endpoints/vadalingo"},{"title":"Apps","href":"/integrations/api-endpoints/apps"},{"title":"Schedules","href":"/integrations/api-endpoints/schedules"},{"title":"Context Layer","href":"/integrations/api-endpoints/context-layer"},{"title":"AI Agent","href":"/integrations/api-endpoints/agent"},{"title":"Assistant","href":"/integrations/api-endpoints/assistant"},{"title":"Chat History","href":"/integrations/api-endpoints/chat-history"},{"title":"Alerts","href":"/integrations/api-endpoints/alerts"},{"title":"Compute","href":"/integrations/api-endpoints/compute"}]}]},{"group":"Examples","pages":[{"title":"Examples Overview","href":"/examples/overview"},{"group":"Patterns","pages":[{"title":"Graph Analytics","href":"/examples/patterns/graph-analytics"},{"title":"Recursion","href":"/examples/patterns/recursion"},{"title":"State Machine","href":"/examples/patterns/state-machine"}]},{"group":"Finance","pages":[{"title":"Banking Supervision","href":"/examples/finance/banking-supervision"},{"title":"Card Clearing Migration","href":"/examples/finance/card-clearing-migration"},{"title":"Non-Performing Loans","href":"/examples/finance/non-performing-loans"}]}]},{"group":"Vadalog Reference","pages":[{"title":"What is Vadalog?","href":"/vadalog/overview"},{"title":"Thinking in Vadalog","href":"/vadalog/thinking-in-vadalog"},{"title":"Grammar Reference","href":"/vadalog/grammar"},{"title":"Language Primitives","href":"/vadalog/language-primitives"},{"title":"Rules","href":"/vadalog/rules"},{"group":"Expressions","pages":[{"title":"Expressions","href":"/vadalog/expressions/overview"},{"title":"Operators","href":"/vadalog/expressions/operators"},{"title":"Negation","href":"/vadalog/expressions/negation"},{"title":"Conditions \u0026 Assignments","href":"/vadalog/expressions/conditions-assignments"},{"title":"Recursion","href":"/vadalog/expressions/recursion"},{"title":"Aggregations","href":"/vadalog/expressions/aggregations"},{"title":"Collections","href":"/vadalog/expressions/collections"},{"title":"Specialized Functions","href":"/vadalog/expressions/specialized-functions"},{"title":"AI Functions","href":"/vadalog/expressions/ai-functions"}]},{"title":"Annotations","href":"/vadalog/annotations"},{"title":"Data Sources","href":"/vadalog/data-sources"},{"title":"Chase \u0026 Provenance","href":"/vadalog/chase-provenance"},{"title":"Explanations","href":"/vadalog/explanations"},{"title":"Graph Analytics","href":"/vadalog/graph-analytics"},{"title":"SQL Integration","href":"/vadalog/sql-integration"},{"title":"Cypher Integration","href":"/vadalog/cypher-integration"},{"title":"Engine API (Low-Level)","href":"/vadalog/engine-api"}]},{"group":"Resources","pages":[{"title":"FAQ","href":"/resources/faq"},{"title":"Learning Resources","href":"/resources/community"}]}]},"basePath":"","title":"Context as code - Prometheux","buildId":"2b1ecce0afe8","dynamics":[],"chunks":[]}