| name | palantir-reference-architecture |
| description | Implement Palantir Foundry reference architecture with best-practice project layout.
Use when designing new Foundry integrations, planning data pipeline architecture,
or establishing patterns for Ontology-driven applications.
Trigger with phrases like "palantir architecture", "foundry best practices",
"foundry project structure", "how to organize palantir".
|
| allowed-tools | Read, Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","palantir","foundry","architecture","patterns"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Palantir Reference Architecture
Overview
Production-ready architecture for Foundry-integrated applications. Covers the standard data pipeline pattern (ingest > clean > model > serve), Ontology design, external API integration, and multi-repo project layout.
Prerequisites
- Foundry enrollment with project access
- Understanding of Ontology concepts (object types, link types, actions)
- Familiarity with
palantir-core-workflow-a (transforms) and palantir-core-workflow-b (Ontology)
Instructions
Step 1: Data Pipeline Architecture
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
โ Raw Layer โโโโโ>โ Clean Layer โโโโโ>โ Model Layer โโโโโ>โ Ontology โ
โ (ingested) โ โ (validated) โ โ (enriched) โ โ (objects) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
โ Connectors @transform_df @transform_df Object types
โ REST sync null checks joins, aggs Link types
โ File upload type casting ML features Actions
Step 2: Project Layout (Foundry)
Foundry Project: "Customer Analytics"
โโโ Datasets/
โ โโโ raw/ # Ingested from sources
โ โ โโโ raw_orders # REST connector โ CRM
โ โ โโโ raw_customers # JDBC connector โ DB
โ โ โโโ raw_products # File upload (CSV/Parquet)
โ โโโ clean/ # Validated, typed
โ โ โโโ clean_orders # Nulls removed, dates parsed
โ โ โโโ clean_customers # Deduped, normalized
โ โ โโโ clean_products # Schema enforced
โ โโโ model/ # Enriched, analytics-ready
โ โโโ order_enriched # Joined with customer + product
โ โโโ customer_360 # Aggregated customer view
โ โโโ daily_summary # Time-series aggregation
โโโ Code Repositories/
โ โโโ pipeline-ingestion/ # Connectors and raw โ clean
โ โโโ pipeline-analytics/ # Clean โ model transforms
โ โโโ ontology-actions/ # Action implementations
โโโ Ontology/
โโโ Object Types: Customer, Order, Product
โโโ Link Types: CustomerโOrders, OrderโProducts
โโโ Actions: createOrder, updateCustomerSegment
Step 3: External API Integration Pattern
# External app consuming Foundry Ontology via Platform SDK
my-external-app/
โโโ src/
โ โโโ foundry/
โ โ โโโ client.py # Singleton FoundryClient
โ โ โโโ objects.py # Object query helpers
โ โ โโโ actions.py # Action wrappers
โ โ โโโ cache.py # TTL cache layer
โ โโโ api/
โ โ โโโ routes.py # REST endpoints
โ โ โโโ webhooks.py # Foundry event handlers
โ โโโ main.py
โโโ tests/
โ โโโ conftest.py # Mocked FoundryClient
โ โโโ test_objects.py
โ โโโ test_actions.py
โโโ .env # FOUNDRY_HOSTNAME, credentials
โโโ requirements.txt