Login to follow
OKF Agent

OKF Agent (ODC)

Stable version 0.1.0 (Compatible with ODC)
Uploaded on 3 Aug (2 weeks ago) by Michael Guzman
OKF Agent

OKF Agent (ODC)

Documentation
0.1.0

Installation

  1. Install OKF Store first. OKF Agent calls its service actions directly and will not publish without it.
  2. Install PromptAssembler. OKF Agent fetches its system prompt from this app on every message and will not publish without it either.
  3. Install OKF Agent from Forge, or import the .oml if installing from a release package.
  4. Configure the AI Model Connection. OKF Agent's model is bound through AIProviderForOKF, an OpenAI model connection. Supply valid credentials for this connection before publishing; without them, calls to CallOKFAgent will fail at the model step.
  5. Publish the app.

Configuration

  1. In PromptAssembler, create or confirm a prompt record with template key okf_agent_system. OKF Agent looks up this exact key on every call; if no record exists under this key, the agent runs with no system prompt.
  2. This component ships with the prompt already used to build and test it, as a Resource file, okf_agent_system.md, included with the component. The same file is also available in the GitHub repo at github.com/michaeldeguzman/Google-OKF-Forge/tree/main/ODCResources. Use it as the starting content for the okf_agent_system record, or replace it with your own.
  3. No Site Properties exist in OKF Agent itself. All configuration lives in the AI Model Connection and in PromptAssembler.

Calling the Agent

OKF Agent has no screens of its own. It is called entirely through its service actions; a consuming app or flow needs to be built separately.

  1. Call CallOKFAgent with UserInput (the question, as text) and SessionId (any caller-chosen identifier used to keep a conversation's history together across calls).
  2. Read Response, the agent's free-text answer.
  3. To inspect what happened during that call, call DownloadLatestTrace immediately afterward. It takes no inputs and returns the call's tool-call log as Binary and JSON, both representing the same data. This only reflects the single most recent call; the underlying Trace entity is cleared at the start of every new invocation, so trace data does not accumulate across calls.

A set of test questions used during this component's own testing ships as a Resource file, okf-agent-test-questions.md, useful as a starting point for exercising the agent against a real bundle.


Tools Available to the Agent

Six tools are wired into the agent, each a thin wrapper over an OKF Store service action. Every argument is filled by the model; none are pre-set.

  • ListBundles — no inputs. Returns every ingested bundle. Typically the first call in a conversation, since every other tool operates within one bundle.
  • GetBundleIndex — BundleId, optional DirectoryPath. Returns a lightweight index of concepts in a bundle, optionally scoped to part of it.
  • GetConceptByPath — BundleId, ConceptPath. Returns one concept's full detail, with resolved outbound and inbound links attached.
  • ListConcepts — BundleId, optional Filter. Returns a filtered list of concepts. See below; this is the one tool that transforms its input before calling OKF Store.
  • GetInboundLinksByPath — BundleId, ConceptPath. Returns the concepts that link into a given concept.
  • GetOutboundLinksByPath — BundleId, ConceptPath. Returns a concept's resolved outbound links.

How ListConcepts's Filter Is Translated

The model is given a Filter shaped for text input, not OKF Store's underlying entity Identifier. Its MinTrusTier field takes a trust tier name directly, "Unverified", "MachineConfirmed", or "HumanReviewed", rather than a numeric Id.


Before calling OKF Store, the agent looks up that name against the TrustTierOption static entity. If no match is found, an error is returned immediately without calling OKF Store. If found, the resolved Identifier is substituted in, and every other filter field, TypeFilter, StatusFilter, IsExcludeStale, IsExcludeDeprecated, AsOfDate, is passed through unchanged.


System Prompt

OKF Agent does not store its own system prompt. On every message, it calls PromptAssembler's Assemble_Prompt service action with the key okf_agent_system and no runtime variables, and uses whatever prompt text that call returns. There is no caching; changing the prompt in PromptAssembler takes effect on the very next message, with no republish of OKF Agent required.


Entities

  • Memory (private) — one row per message in a session's conversation history, keyed by SessionId, holding role and content. Used to reconstruct conversation history across calls sharing the same SessionId.
  • Trace (public) — one row per tool call made during the most recent invocation: action name, parameters, and result. Cleared at the start of every new call to CallOKFAgent, so it never holds more than one call's worth of history at a time.

Dependencies

  • OKF Store — the six wired tools call its service actions directly, and this app also consumes its Bundle, Concept, TrustTierOption, and IngestSource entities and related structures.
  • AIProviderForOKF — an OpenAI Model Connection; the agent's bound AI model.
  • PromptAssembler — supplies the system prompt via Assemble_Prompt, called on every message.
  • (System) and BinaryData — used internally for trace assembly and the binary export in DownloadLatestTrace.

No Site Properties, REST integrations, or additional AI provider references exist beyond AIProviderForOKF.