ONTOLOGYAutomated Ontology Function DevelopmentAug 1, 2026

How an FDE Uses AI FDE: Ontology Functions

#Palantir Foundry#Ontology#AIP FDE#TypeScript#Function Development
✦ AI SUMMARY

This Palantir Foundry video demonstrates leveraging AIP FDE (AFDE) to automate the creation, testing, and deployment of TypeScript Ontology functions within a "Climbing Gym Ontology" example. AFDE guides users through defining function specifications, automatically generating code by exploring the ontology, and interactively debugging via function previews before merging changes and deploying them to applications.

In this video, "How an FDE Uses AI FDE: Ontology Functions" by Ontologize, a Palantir Forward Deployed Engineer (FDE) demonstrates how to leverage AIP FDE (AFDE) to automatically write, test, and deploy TypeScript Ontology functions in Palantir Foundry [00:00].

The walkthrough uses a Climbing Gym Ontology dataset (containing objects like Gym, Member, Route, Send, Visit, and Membership) to author three operational functions and deploy them into a user-facing Palantir Workshop application [00:46].


Step-by-Step Guidance: Authoring & Deploying Functions with AFDE

1. Initialize AFDE & Define Prompts
   └── Open AFDE (Ctrl + J) ──> Specify target project/folder ──> Prompt 3 function specs

2. Automated Exploration & Code Generation
   └── Mode switch (Explore) ──> TypeScript v2 selection ──> Branch & SDK setup ──> File creation

3. Interactive Testing & Diagnostic Fixes
   └── Function Preview execution ──> Primary key / schema fix ──> Commit & Publish

4. Merging PRs & Ontology Proposals
   └── Code Repository PR (Squash & Merge) ──> Ontology Manager Global Proposal Merge

5. Application Building in Palantir Workshop
   └── Object Table ──> Function-backed Property ──> Sort & Visualize

  1. Initialize AFDE and Define Clear Prompts: Specify inputs, business logic, and output shapes precisely.
  2. Open AFDE by pressing Ctrl + J in Palantir Foundry and searching for AFDE [01:06].
  3. Point AFDE to a project folder where it has permissions to create repositories and code files [08:28].
  4. Provide precise prompts detailing expected function inputs, data relationships, edge cases, and output schemas [02:22]:
  • Occupancy Percent (gymOccupancyPercent): Takes a Gym object and start/end timestamps; calculates overlapping Visit durations over gym capacity [02:45].
  • Projector Count (projectorCount): Takes a Route object set and returns a map of distinct members whose Send history has attempt statuses but no completed sends [04:20].
  • Renew Membership (renewMembership): Takes a Member object, membership tier, and duration; resolves previous active/frozen memberships, updates pricing, and generates a new active record [06:12].
  1. Automated Exploration and Code Generation: Allow AFDE to inspect schemas before writing code.

  2. AFDE automatically enters Exploration Mode to inspect linked object types and schemas across the target ontology [09:01].

  3. Select the target runtime environment (e.g., TypeScript v2) [09:47].

  4. AFDE creates a local development branch, generates SDK packages, and scaffolds the TypeScript source files [09:52].

  5. Interactive Testing and Self-Correction: Validate previews and resolve schema mismatches.

  6. Approve tool permissions for running Function Previews against live sample data [10:55].

  7. Observe AFDE as it detects diagnostic errors (e.g., primary key formatting mismatches like - vs _) and automatically corrects its logic [11:14].

  8. Confirm successful execution previews for each function [11:30].

  9. Merge Code PRs and Ontology Proposals: Deploy changes from branches to main.

  10. Open the generated Pull Request (PR) in the code repository, review checks, and perform a Squash and Merge into main [13:24].

  11. Navigate to the Ontology Proposal generated for function-backed action types (Global Branch) and click Merge Proposal [14:13].

  12. Integrate Functions into Workshop Applications: Expose logic to end-users.

  13. Launch Workshop via Ctrl + J and create a blank module [14:30].

  14. Add an Object Table populated with Route objects [15:15].

  15. Add a Function-Backed Property column selecting projectorCount to render the derived property per row [15:46].

  16. Sort table columns by projector count to give operational staff real-time visibility into high-difficulty routes [16:20].


Use Case Analysis: Climbing Gym Operational Management

The video illustrates how AI FDE converts raw operational ontology data into actionable business tools across three core operational patterns:

Function / ActionFunction TypeBusiness ObjectivePalantir Workshop Implementation
gymOccupancyPercentComputed MetricMeasures capacity utilization over a custom time window by checking overlapping visitor check-in/checkout intervals [02:45].Backs numeric KPI summary widgets and time-series metric cards for facility managers [16:48].
projectorCountDerived Property (Map)Identifies climbing routes where members are struggling (high attempt count without success) [04:20].Populates custom derived columns in Object Tables and drives conditional map/chart formatting [15:46].
renewMembershipFunction-Backed ActionAutomates membership state transitions, price calculations, and frozen state expirations [06:12].Backs user action buttons and inline forms within operational workflows [16:54].

Key Takeaways for Forward Deployed Engineers (FDEs)

  • Prompt Precision: FDEs must clearly define input/output structures, domain edge cases (e.g., handling frozen memberships before creating new ones), and boundary math [02:22].
  • Feedback Loop: AFDE relies on live code execution previews to test assumptions against actual ontology data before submitting code [10:55].
  • Human-in-the-Loop Governance: AI handles boilerplate writing, SDK setup, and diagnostic fixes, while the engineer approves executions, audits code, and merges PRs [12:20].

Authoring TypeScript v2 Ontology Functions manually without AI FDE involves working directly within Palantir Foundry’s Code Repositories module and consuming them via Workshop.

The workflow breaks down into repository setup, coding patterns, testing/publishing, and Workshop wiring.


Manual Authoring & Deployment Workflow

  1. Create a Code Repository: Initialize repo with TypeScript v2 Functions template.

  2. In Foundry, navigate to your target folder, click + New, and select Code Repository.

  3. Choose TypeScript Functions as the language/template, and select TypeScript v2 as the SDK/version.

  4. Branch off main to create a working feature branch (e.g., feature/my-ontology-functions).

  5. Configure Ontology Dependencies: Generate SDK bindings for required Object Types.

  6. Open the repository's Ontology Dependencies or SDK Packages tab on the left sidebar.

  7. Search for and select the Object Types needed (e.g., Gym, Member, Route, Send).

  8. Click Save and Regenerate SDK so @osdk/functions and @ontology/sdk generate typed imports for your data schema.

  9. Write the Function Logic: Decorators, maps, and edit types. In src/index.ts (or individual .ts files), import your generated objects and decorators from @foundry/functions-api or @osdk/functions:

  • Computed Metric / Query Function:
import { Function, Integer } from "@foundry/functions-api";
import { Gym, Visit } from "@ontology/sdk";

export class GymAnalytics {
  @Function()
  public async gymOccupancyPercent(
    gym: Gym, 
    startTime: Date, 
    endTime: Date
  ): Promise<Double> {
    const visits = await gym.visits.getAsync();
    // Perform boundary math...
    return averageOccupancy;
  }
}

  • Derived Property (Map for Workshop Object Tables):
import { Function, TwoDimensionalAggregation } from "@foundry/functions-api";
import { ObjectSet, Route } from "@ontology/sdk";

export class RouteFunctions {
  @Function()
  public async projectorCount(
    routes: ObjectSet<Route>
  ): Promise<FunctionsMap<Route, Integer>> {
    const result = new FunctionsMap<Route, Integer>();
    // Map routes to member attempt counts...
    return result;
  }
}

  • Ontology Edits (Function-Backed Action):
import { Edits } from "@osdk/functions";
import { Member, Membership } from "@ontology/sdk";

type MemberEdits = Edits.Create<Membership> | Edits.Update<Member>;

export class MembershipActions {
  @Function()
  public async renewMembership(
    member: Member,
    tier: string,
    durationMonths: Integer
  ): Promise<MemberEdits> {
    // Construct edit payload or staged write
    return edits;
  }
}

  1. Test in Code Repositories: Execute previews with live data before committing.

  2. Open the Functions Helper / Preview panel on the right side of Code Repositories.

  3. Select your function name and supply mock or live Ontology object primary keys as parameter inputs.

  4. Click Run Preview to evaluate the code and inspect the raw return payload or TypeScript errors directly in the console.

  5. Tag, Release, and Propose: PR, Merge, and Action Type Configuration.

  6. Merge Code PR: Submit a Pull Request and merge your feature branch into main. The repository automatically tags and publishes a release version.

  7. Configure Action Type (If writing Edit functions):

  • Open Ontology Manager.
  • Create a new Action Type (e.g., Renew Membership).
  • Under Logic, select Function-backed and choose your published renewMembership function.
  • Map the action parameters to the function arguments and save/publish the proposal.
  1. Consume in Palantir Workshop: Wire the published functions into UI components.
  2. Launch Workshop and open your module.
  3. For Derived Table Columns: Add an Object Table, edit columns $\rightarrow$ Add Column $\rightarrow$ Function-backed Property, and select your projectorCount function.
  4. For Action Buttons: Add a Button / Button Group widget $\rightarrow$ Set On-Click action to Action Type $\rightarrow$ Select your function-backed action.
  5. For Variables: Add a variable $\rightarrow$ Type: Function-backed $\rightarrow$ Select your metric or Object Set returning function.

Key Differences: Manual vs. AI FDE

AspectManual AuthoringWith AI FDE (AFDE)
SDK ScaffoldingManual import search in Ontology settings & manual compilation.Automatically detects objects and triggers SDK builds.
Diagnostics & TypesManually reading TypeScript runtime errors in the editor.Automatically catches schema mismatches (e.g., _ vs - in keys) and self-corrects.
Action Type CreationMust switch to Ontology Manager to manually construct logic bindings.Generates a Global Branch proposal for the Action Type directly in chat.