Skip to content

YedaAI/YedaFlow_Palantir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YedaFlow: Cross-System Order Intelligence Pipeline on Palantir Foundry

License Node Tests Golden cases Built on Palantir Foundry

Visit Yeda AI · Contact us · Watch the walkthrough · Build this on Foundry · Open-source scope · Use case · Demo script

YedaFlow turns two disagreeing order systems into one governed ontology that an AI agent can reason on. The pipeline reconciles identity, normalizes the rows, computes typed exception signals, and hands a read-only surface to the sibling YedaAgents (Yara, Yopa, Yoca) — the agent layer reads, never writes back into the pipeline.

YedaFlow hero — pipeline DAG, AIP Logic streaming, and the governed agent hand-off in one view

Need the production version with tuned anomaly thresholds, customer-specific connectors, the full benchmark grid, enterprise auth, and tenant scaffolding? Talk to Yeda.

Why this repo matters

  • It demonstrates the substrate that makes a governed AI agent layer possible: clean cross-system unification, typed exceptions, and a one-way read-only hand-off.
  • It maps a real revenue-operations use case cleanly across Palantir Foundry surfaces — Pipeline Builder, Ontology, Functions, AIP Logic, OSDK, Automate — instead of stopping at prompt snippets.
  • It enforces the architectural invariants in code: empty source_refs is rejected at the action boundary, malformed streaming chunks are dropped (never coerced), and the agent hand-off surface is read-only by type construction (AgentReadSurface).
  • It is the public, open-source slice of Yeda AI's YedaFlow pipeline product, not a toy mockup.

Who this is for

  • Data-platform engineers, operations leads, and revenue-operations engineers running an enterprise where order, customer, and billing systems do not agree.
  • Palantir Foundry teams looking for a concrete Pipeline Builder + Ontology + AIP Logic + OSDK pattern with a governed agent boundary.
  • Developers studying typed pipeline composition, eval-gated LLM flows, and the read-only-projection pattern for agent hand-off.
  • Prospective Yeda customers who want operational AI grounded on real reconciled state, not vibes.

Product snapshots

Prefer a moving picture? Open the animated demo GIF or watch the 60–90s walkthrough video.

Pipeline run inspector — complete vs partial runs; a missing feed is flagged, never silently filled

YedaFlow run inspector

Exception queue — typed exceptions grouped by kind, sorted by severity

YedaFlow exception queue

Exception drilldown — every claim cites the source rows it was built from

YedaFlow exception drilldown

Governed threshold tuning — AIP Logic drafts the suggestion; the engineer applies it; the LLM never invokes the action

YedaFlow threshold review

What this is

This repo is the open-source slice of Yeda AI's YedaFlow Pipeline Starter, built on Palantir Foundry. It demonstrates the four headline capabilities:

Capability What you can see
Multi-source unification Bureau + office + customer master → one canonical Order shape, identity-resolved by email/phone/name.
Anomaly intelligence Four typed detectors over normalized rows: cross-system mismatch, due-date risk, assignee inconsistency, record incomplete.
Operationalization Typed OrderExceptions land in an operator queue with deterministic rationale + LLM streaming explanation; routed/acknowledged via typed actions.
Governed agent hand-off agents/handoff.ts reads the same ontology the sibling YedaAgents will read — and only the read methods compile.

Full story: docs/use-case.md.

Run the agent-handoff digest to see the read-only contract in action:

pnpm --filter @yedaflow/agents handoff

End-to-end pipeline run

Generate the synthetic data and run the four pipelines end-to-end:

pnpm sample-data:generate
pnpm pipelines:check        # DAG-shape sanity + small fixture roundtrip

For the full operator experience, open the React app:

pnpm app:dev   # alias for `pnpm --filter @yedaflow/app dev`
# then open http://localhost:5179

The dev port is pinned to 5179 so it never collides with the sibling Yeda repos (Yara → 5173, Yopa → 5174, Yoca → 5175).

Optional: enable the real LLM streaming path

The streaming panels (summarize_run, explain_exception) ship with deterministic mock chunks so the public repo runs without an API key. When you do want to see real model output, run the companion proxy in a second terminal:

# Terminal A — the operator app
pnpm app:dev

# Terminal B — the LLM proxy (only useful if ANTHROPIC_API_KEY is set)
cp .env.example .env       # then edit .env and set ANTHROPIC_API_KEY=…
ANTHROPIC_API_KEY=… pnpm proxy:start

The proxy listens on http://127.0.0.1:5180 and owns the API key — the browser never sees it. Vite's dev server forwards /api/* requests to it. When the proxy is up, the Header chip flips from fixtureLLM live and every AiCallAuditRow records source: "live". When it's down or ANTHROPIC_API_KEY is unset, the app silently falls back to mock chunks — no broken state.

The proxy refuses to start without ANTHROPIC_API_KEY (exit code 0 with a clear message), so it's safe to wire into CI.

Folder map

Each top-level folder maps to one Palantir product surface. The mapping is the architectural backbone — code in each folder targets that product's conventions.

YedaFlow_Palantir/
├── sample-data/    ← synthetic customers + 2 order feeds + weekly usage; deterministic generator
├── ontology/       ← Customer / Order / OrderException / PipelineRun / DataQualitySignal markdown specs
├── pipelines/      ← 4 Pipeline Builder DAG mirrors with spec.md + inputs.md + transforms.ts
├── functions/      ← deterministic identity / scoring / summaries (no LLM)
├── logic/          ← 3 AIP Logic flows (explain_exception, summarize_run, propose_threshold_tune) + chunk parser
├── app/            ← React operator app over an OSDK fixture
├── automations/    ← exception_alerts + daily_quality_digest sketches
├── agents/         ← typed read-only OSDK consumer that proves the one-way agent contract
└── evals/          ← golden cases + benchmark matrix + consistency checks + prompt-injection smoke + runner

Quick start

pnpm install                        # install workspace deps
pnpm sample-data:generate           # write 4 deterministic CSV feeds
pnpm -r typecheck                   # 8 workspaces typecheck clean
pnpm -r lint                        # 8 workspaces lint clean
pnpm -r --if-present test           # 142 tests green
pnpm pipelines:check                # DAG-shape + smoke roundtrip
pnpm eval:smoke                     # golden + benchmark + consistency + injection (smoke)
pnpm app:build                      # Vite production build
pnpm app:dev                        # operator app dev server (http://localhost:5179)

Architecture invariants enforced in code

These invariants are checked by tests, types, or both:

  • Cited exceptions — every OrderException carries non-empty source_refs. The fixture action throws on empty input; the schema rejects it in the real Foundry deployment.
  • Explicit gaps — when a source feed is absent, PipelineRun.status = "partial" and missing_sources is non-empty. ClosePipelineRun rejects status/missing-sources contradictions.
  • No LLM writeback — flows in logic/ cannot invoke ontology actions. Writeback flows through typed actions invoked by the app, the engineer drawer, or the pipeline runner.
  • Structured streaminglogic/runtime/parse-stream.ts drops malformed chunks; it never coerces free text into a typed shape.
  • One-way agent hand-offAgentReadSurface is a TypeScript Pick of the read methods. Calling agent.acknowledgeException(...) is a compile error; the runtime assertion in agents/handoff.test.ts is belt-and-braces.
  • Benchmark gating — prompt or model changes that move the golden-case scores or the benchmark matrix past their thresholds block merge.

Build this for real

The architecture is intentionally the same between local and deployed; only the substrate changes. The lift-and-shift path — CSV → Pipeline Builder ingests, fixture → generated OSDK, local proxy → AIP Logic — is documented step by step in docs/build-on-foundry.md.

If you want the production version with tuned thresholds, the full benchmark grid, real connectors, enterprise auth, and tenant deployment support, contact Yeda.

What stays commercial

The following stay in the commercial repo and are deliberately not in this public slice (full list in docs/open-source-scope.md):

  • Tuned anomaly thresholds and exception-routing rules.
  • Production prompts for the explanation and summary panels (the public repo carries skeletons only).
  • Customer-specific connectors and enterprise normalization rules.
  • The benchmarking suite that actually drives model selection (the public repo ships smoke-mode only).
  • Enterprise auth, role mapping, and tenant scaffolding.

Local development

  • Use the Node version in .nvmrc (22.22.2).
  • Use pnpm (9.15.0).
  • The eval suites all run without an ANTHROPIC_API_KEY in smoke mode; setting one unlocks the model-backed paths in the commercial repo.

See CONTRIBUTING.md for how to contribute.

Demo recording

A 60–90 second walkthrough is recorded in docs/media/yedaflow-walkthrough.webm (animated preview: docs/media/yedaflow-demo.gif). The recording contract — beat sheet and required on-screen elements — is in docs/demo-script.md.

License

Apache-2.0. See LICENSE and NOTICE.

About

Cross-system order intelligence pipeline on Palantir Foundry with cited exceptions and a governed read-only agent hand-off

Topics

Resources

License

Code of conduct

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors