KNOWX · 00
Audience: Developers implementing the first-party KnowX agent — vocabulary, services, and pipeline.
Twin: Builders version
Scenario: Fresh sandbox* · install ops then knowx · agentIds: ["knowx"] (inherits ops).
Packages: @x12i/memorix-knowx-pack, @x12i/memorix-ops-pack, @x12i/memorix-service, @x12i/memorix-pipeline, @x12i/memorix-format, @x12i/memorix-relationships.
Prerequisites: Agent packs · Services · Pipelines · Format.
Site: https://ebooks.memorix.x12i.com · Hard rules
Status: Present-tense tutorial for the shipped @x12i/memorix-knowx-pack. Deterministic fixture stubs — no live AI required. Replace stubs with real service bodies using the Memorix contracts in §B.
KNOWX · 00
Work in authoring order: A vocabulary → B services → C pipeline → D install & run.
knowx) plus a first-party agent pack — not a siloed graph engine.knowx is a child of ops. Scope with agentIds: ["knowx"] so inheritance collapses ops + knowx.knowx-ingest-associate persists via write-record and relationship-write.epistemic.state ≠ extraction confidence.associated*, no abstract collections.Labels: Stored subject content · Virtual abstract projection · Operational run ledgers.
KNOWX · 00
text + knowledgeSource
→ knowx-extract (drafts only)
→ write-record knowx (knowledge added)
→ knowx-associate-knowledge
→ relationship-write (known / supports / contradicts / derived-from)
→ knowx-associate-entities
→ relationship-write (edge-from / edge-to)
flowchart LR
Text[text plus knowledge source] --> Extract[knowx-extract]
Extract --> Write[write-record knowx]
Write --> AssocK[knowx-associate-knowledge]
AssocK --> RelK[relationship-write knowledge links]
RelK --> AssocE[knowx-associate-entities]
AssocE --> RelE[relationship-write entity links]
KNOWX · 00
memorix-format registers knowx and confirmations. Payload rules:
| Layer | Name | Stored? |
|---|---|---|
| Content type | knowx |
Yes |
| Discriminator | data.kind: NODE | EDGE |
Inside .data |
| Abstract | KnowXEntity |
Virtual only |
| Forbidden | KnowXNode / KnowXEdge types or collections |
— |
Package: @x12i/memorix-knowx-pack
metadata/
agents/knowx.json # parentAgentId: ops
abstract-types.json # KnowXEntity (+ People/WorkItems restated for standalone validate)
abstract-bindings.json # knowx-entity-union
object-types.json # employees/contractors/work-items overlays + assertions
relationship-definitions.json
services.json
pipelines-and-sources.json
fixtures/knowx-activity-log.jsonl
src/knowx-services.ts # deterministic stubs
Known pack id: knowx → memorix-metadata/examples/knowx/normalized/pack.json (explicit install only).
| OT | Role |
|---|---|
employees / contractors / work-items |
Host OTs — knowx pack replaces ops defs to add CT knowx + KnowXEntity |
assertions |
Claim subjects — CTs knowx (required), workflow, confirmations |
NODE facets share the host recordId. EDGE claims get their own recordId on assertions.
| Id | Classification / use |
|---|---|
knowx-same-as |
known — matches existing claim |
knowx-supports |
Reinforces existing |
knowx-contradicts |
contradicts existing |
knowx-derived-from |
Derived from another claim |
knowx-edge-from |
EDGE → domain from-endpoint |
knowx-edge-to |
EDGE → domain to-endpoint |
Domain assignment links may still use ops people-assigned-to-work-items after human accept (operator flow).
type SourceSpan =
| { jsonPath: string }
| { lineStart: number; lineEnd: number }
| { byteStart: number; byteEnd: number };
type KnowxProvenance = {
sourceClass: "measured" | "inferred" | "asserted" | "imported";
sources: Array<{
docId: string;
docType: string;
docHash: string; // sha-256 of exact source bytes
span: SourceSpan;
retrievedAt: string;
}>;
extraction: {
method: string;
extractorId: string;
confidence: number; // ≠ epistemic.state
};
};
Missing provenance ⇒ reject writes / fail the extract step.
KNOWX · 00
These are the Memorix-facing contracts. Implement real bodies against them; fixture stubs in @x12i/memorix-knowx-pack satisfy acceptance without live AI.
Shared rules for all three
analyze (pipeline stepKind: "analyze").kind: "worker" + operation matching the service id.associated*.orgId + agentIds (use ["knowx"]).knowx-extract| Role | Turn text + knowledge source into KnowX drafts (NODE/EDGE), not yet classified. |
| serviceId | knowx-extract |
| operation | knowx-extract |
| Inputs | text — string to analyze; knowledgeSource — exact bytes or Memory DataRef + envelope (docId, docType, retrievedAt) |
| Output | knowxDrafts: KnowxDraft[] plus docHash of exact source bytes |
| Draft shape | { objectType, contentType: "knowx", recordId, data } with data.kind, provenance, epistemic; EDGE also has data.refs.{from,to,predicate} |
| Errors | MISSING_SOURCE, INVALID_SOURCE_BYTES, MISSING_PROVENANCE |
| Handoff | Pipeline step write-knowx (write-record, contentType: "knowx") consumes knowxDrafts |
| Fixture stub | extractKnowxFromActivityLog — parses fixtures/knowx-activity-log.jsonl → employee NODE, work-item NODE, ASSERTION-99 EDGE |
knowx-associate-knowledge| Role | Classify drafts against existing KnowX scope: known, novel, contradicts; emit knowledge relationship plans. |
| serviceId | knowx-associate-knowledge |
| operation | knowx-associate-knowledge |
| Inputs | drafts — from extract (or already written knowx); existingKnowx — current contentType=knowx in scope |
| Output | classification: { known[], novel[], contradicts[] }; relationshipPlans[] |
| Plan item | { definitionId, from: { objectType, recordId }, to: { objectType, recordId }, reason? } where definitionId ∈ knowx-same-as | knowx-supports | knowx-contradicts | knowx-derived-from |
| Errors | MISSING_DRAFTS, INVALID_CLASSIFICATION |
| Handoff | Step write-knowledge-links (relationship-write) consumes relationshipPlans |
| Fixture stub | Same objectType+recordId → known + knowx-same-as; EDGE same endpoints different predicate → contradicts + knowx-contradicts; else novel |
knowx-associate-entities| Role | Associate novel KnowX (especially EDGE) to existing domain entities. |
| serviceId | knowx-associate-entities |
| operation | knowx-associate-entities |
| Inputs | novelDrafts — from classification.novel (resolve full drafts); entityCatalog — available entity endpoints / abstracts |
| Output | entityRelationshipPlans[] with definitionId ∈ knowx-edge-from | knowx-edge-to (optional domain defs) |
| Errors | MISSING_NOVEL, UNRESOLVED_ENDPOINT |
| Handoff | Step write-entity-links (relationship-write) consumes entityRelationshipPlans |
| Fixture stub | For each novel EDGE, emit plans from data.refs.from / data.refs.to |
serviceId / operation / output field names.analyze services).KNOWX · 00
| Step id | kind | Binding |
|---|---|---|
extract |
analyze |
serviceId: knowx-extract |
write-knowx |
write-record |
contentType: knowx |
associate-knowledge |
analyze |
serviceId: knowx-associate-knowledge |
write-knowledge-links |
relationship-write |
plans → knowledge defs |
associate-entities |
analyze |
serviceId: knowx-associate-entities |
write-entity-links |
relationship-write |
plans → edge-from/to |
Optional later (operator-driven): workflow + confirmations before treating epistemic as fact; materialize domain links such as people-assigned-to-work-items.
Run evidence lives in the pipeline operational ledger — not in subject content.
KNOWX · 00
# 1) Install parent ops, then knowx (never auto-install)
POST /api/metadata/install { "packId": "ops", "confirm": true }
POST /api/metadata/install { "packId": "knowx", "confirm": true }
# 2) Scope — child agent collapses ops inheritance
X-Memorix-Org-Id: sandbox…
X-Memorix-Agent-Ids: knowx
# 3) Start pipeline with text + knowledge source inputs
POST /api/pipelines/start
{ "pipelineId": "knowx-ingest-associate", … }
Isolation: fresh sandbox* org; beginIsolationSession({ agentIds: ["knowx"] }) when running KnowX acceptance. Default isolation remains ["ops"].
Package tests: cd memorix-knowx-pack && npm test.
KNOWX · 00
On assertion recordId:
knowx — claim + provenance + epistemic workflow — review assignment (PUT /api/workflow) confirmations — accept/rejectAccepted EDGE → optional domain relationship materialize (Explore / relationship APIs). Heavy JSON stays on the claim; links are navigation only.
KNOWX · 00
knowx with parentAgentId: "ops"KnowXEntity union + assertions OT + knowx CT on host OTsknowx-ingest-associate wired end-to-endpackId: "knowx" installable after opsassociated*, no abstract collections, provenance on every draft