Ontology¶
SharedData is the data layer; the agent the user chooses is the intelligence layer.
| Layer | Does | Never does |
|---|---|---|
Data (KnowledgeBase, KnowledgeOntology, KnowledgeMarket, ResearchMCP) |
stores sources and model outputs, validates them against the claim contract, resolves identity deterministically, publishes verified claims with versioned consensus, links concepts, ranks evidence, binds market series, measures reactions, resolves forecasts from prices, audits every write | call a model, write an answer, infer a cause, merge identities fuzzily |
Intelligence (any MCP-capable agent: sharedagents research or any native agent, Claude Code, Codex CLI) |
finds sources, runs the canonical extraction/verification/link prompts on its own model lane, judges, synthesises answers, builds scenarios, makes forecasts | write to tables except through typed actions |
Cost: the data layer is free. The model calls are the agent's, on whatever lane it uses (a subscription when possible). Market data is read from SharedData's own tables.
Building blocks (Palantir Foundry Ontology -> here)¶
| Foundry | Here | Where |
|---|---|---|
| Object types + properties | 12 types (company, org, person, country, region, commodity, index, currency, product, facility, event, concept), id prefixes, typed properties | KnowledgeOntology.OBJECT_TYPES, kb.object(ref) |
| Interfaces | Actor, Issuer, Tradable, Measurable, Concept | INTERFACES, interfaces(ref) |
| Link types | 35 relations from the claim contract with allowed endpoint types, cardinality, edge and causal sign; plus mentions, same_as, narrower_than, has_series | LINK_TYPES, check_link |
| Time-series properties | Tradable objects bound to SharedData market series (stocks by MIC probe, commodities/indices/rates by front contract) | kb.market.binding/bind/series/price_at |
| Object sets / search around | ranked retrieval over objects, mentions, claims and stated causal paths | kb.objects, kb.query, kb.walk |
| Action types | 8 governed writes, validated against the schema and contract, audit-logged with actor and model | ACTION_TYPES, kb.act, kb.action_log |
| Functions | object view, series, event reaction, impact study, consensus answer, causal walk, forecast resolution | FUNCTIONS |
| Decision lineage / AIP evals | questions, evidence-pinned runs, hypotheses, forecasts, decisions, outcomes, corrections, eval suites, budgeted experiments | kb.research (research workflow) |
| Ontology MCP | typed tools, read-only by default, writes through actions on the single writer | python -m SharedData.ResearchMCP |
kb.ontology / MCP ontology() returns the whole schema with a content-hash version (ontology-<16 hex>); every
action record stores the schema version it ran under.
Retrieval contract¶
kb.query(text, related_to=..., start=..., end=...):
- status:
linked: a claim or a stated causal path connects the subject and the related topic;topic_only: sources discuss the subject, but none connects it to the topic;no_match;no_coverage: the window lies outside observed source dates;- without
related_to:ok,sources_onlyorno_match. - claims: ranked by relevance. Every claim carries
relevancewith these tags: topic_entity: the subject or object is the topic object or one of its confirmed aliases;topic_quote;topic_source: the claim only comes from a document mentioning the topic;related_entityandrelated_quote;score,linked.- sources:
- documents found by text, plus documents the extraction linked to the topic's objects (
entity_mention), so "RUBIO: ..." is found for "Marco Rubio"; speakermarks the subject's own statements: an Actor's name followed by ":" or a speech verb, in news, posts or web pages, never filings;- speakers rank first.
- impact (window given and the related topic is Tradable): an event study of the related object's series at the subject's statements.
- Per horizon (5 min, 30 min, 2 h, 1 day), it gives the return and the z-score against the series' own moves over the previous 5 days.
no_statementsmeans the subject never spoke in the window. Passimpact='mentions'to study every mention instead.- Co-timing is not causation: the agent judges why.
- Choosing the related object: a generic phrase maps to its own series first ("oil" -> WTI front month, "interest rate" -> 10-year note futures, whose price moves opposite to yields). Then an object of that exact name, then commodity/index/currency/concept objects; a company only on an exact name. Matches are whole words: "chip" is not Chipotle.
Agent workflow¶
- Read
ontology(), thenfind_objects/get_objectfor the subject. - Read
coverage, thenquery(status, ranked claims, speakers, impact). create_question->start_run(evidence pinned) ->get_evidence->finish_runwith cited facts, inferences with assumptions, or an abstention.kb.research.ask(...)without a synthesis callback stops atawaiting_synthesis, including when coverage is empty: the data layer does not write answers.- Forecasts with a
marketrule (object,op,threshold) resolve from the bound series withresolve_forecast_from_market; the price observation becomes a registered source and the outcome cites it. - Ingestion, on the writer:
register_sources;extraction_items+extraction_contract, run on the agent's own model, thensubmit_extractions;verification_items, thensubmit_verdicts;build;- links: read
concept_labels, propose pairs, thensubmit_links/submit_same_checks/publish_links.
Every write is an action carrying actor and model.
Mounting the server¶
- Server:
DATABASE_FOLDER=<store> SHAREDDATA_RESEARCH_NAME=RESEARCH python -m SharedData.ResearchMCP. It is read-only by default; setSHAREDDATA_RESEARCH_WRITABLE=1only on the single writer. - Market data: read through ClientAPI (
SHAREDDATA_ENDPOINT,SHAREDDATA_TOKEN). SetSHAREDDATA_MARKET_READER=offlineto disable it. - sharedagents: add it as
mcpServers.knowledgein the global config. Theresearchprofile allowlists its tools, and any other agent gets them throughmcp__knowledge__*in its allowlist. - Claude Code:
claude mcp add knowledge -- python -m SharedData.ResearchMCP, with the same environment. - Codex CLI:
[mcp_servers.knowledge]in~/.codex/config.toml, with the same command and environment.
Limits (stated, not hidden)¶
- Identity: exact rules only. People named by surname alone stay document-scoped; cross-language names link only through confirmed same-as decisions.
- Market series: whatever SharedData's market tables hold. Unmapped topics (for example "chip") report
unbound; an agent canbind_seriesan explicit symbol. - Event studies: one-minute bars, with centered z-scores against exact same-horizon returns over the last 5 days.
Each window uses one concrete contract, chosen at its end from that calendar month and the next three months,
by trailing 24-hour volume available by that time. No contracts are spliced at a month roll.
A pre-event price older than 30 minutes is reported as
closed; this is a staleness heuristic, not an exchange calendar. A horizon is measured once the series has a bar at or after its end; its value is the last trade at or before the end, so a horizon crossing a close uses the closing trade. Horizons not yet observed, or without a trade after the event, return no measurement. Market reads go through the endpoint: one request per day carries every symbol of that day, missing days are fetched in parallel, past days are cached for up to an hour (empty days: five minutes), today is re-read after 30 s and future days are never asked. The table route answers symbol reads from the symbol's own rows.price_atreportsstalebeyond itsmax_staletolerance, and forecast resolution rejects it. Read functions never persist derived bindings. - Action audits: intent is stored before execution, then marked completed or failed. An interrupted operation
can leave
startedand partial writes; this is an audit trail, not a multi-table transaction. Lineage writes use their own immutable records with model/run provenance. Trusted local producers retain the low-level Python APIs; the governed agent boundary is MCP. - Event times: newly registered sources preserve day/time precision, including actual midnight events. Legacy midnight timestamps lack that metadata and are conservatively treated as day-only.
- Coverage is observed source dates, not proof that everything published was ingested.