UNPKG

agentfootprint

Version:

The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.

52 lines • 2.29 kB
"use strict"; /** * agentfootprint/ontology — a declared map of what exists and where, never a * way to fetch it. * * The owner's ruling: an ontology is like a map — it does not provide a way * to get data; it tells and reasons about each node and how to reach a * node, so a model that finds no data can say which node or source would * help further. Declared at build (`defineOntology`), validated against the * agent's tool registry at `.build()`, frozen, on the record as ONE * committed key (`AgentState.ontology`), served as ONE request-only system * piece composed by a pure function (`ontologyPiece`), hashed per receipt * and rebuilt byte-equal by `servedAt`. Never a runtime write, never a * tool, never a fetch path; the library infers nothing from it. * * @example * ```ts * import { defineOntology } from 'agentfootprint/ontology'; * * const map = defineOntology({ * id: 'fleet', * version: '1', * sources: { * inventory: { meaning: 'the switch inventory export', configured: true }, * }, * nodes: { * port: { meaning: 'a physical switch port', sources: [{ source: 'inventory', via: ['lookup_port'] }] }, * port_error_rate: { meaning: 'CRC errors per minute on a port', unit: 'errors/min' }, * }, * edges: [{ from: 'port_error_rate', to: 'port', relation: 'measured-on' }], * }); * * const agent = Agent.create({ provider, model }).tool(lookupPort).ontology(map).build(); * ``` */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("../ontology/index.js"), exports); //# sourceMappingURL=ontology.js.map