Skip to main content
Loading navigation

Build a GLEIF Restructuring Lineage and Ultimate Parent Tracker — implementation

Prompt source

implementation59 lines11 sectionsNo variables1 code block
## Build
Trace historical corporate acquisitions and spin-offs using GLEIF relationship records. Map multi-generational successor entity networks to definitively compute the ultimate parent entity after complex restructuring events.

## User
Corporate Due Diligence Investigator

## Workflow
1. Parse simplified entity identifier records and historical restructuring query parameters.
2. Traverse multi-generational corporate relationship trees to resolve cyclic or split entity relationships.
3. Calculate the post-restructuring ultimate parent entity by tracking the terminal successor node in the directed acyclic graph.
4. Output an interactive restructuring chronology terminating in the computed ultimate parent entity.

## Interface
A DAG-based lineage graph viewer highlighting the ultimate parent node and the path of corporate successor transitions.

## Data
Construct synthetic multi-tier merger event datasets matching GLEIF relationship records, provided as simplified synthetic app records, not complete official schema files.
Starter examples below are synthetic. They are not downloaded records.

## Source
[GLEIF API](https://www.gleif.org/en/lei-data/gleif-api)
GLEIF API corporate relationship structures (parent and child relationships and Golden Copy data models).

## Tools
langgraph, fastapi, networkx.
Manages cyclical traversal states while resolving multi-generation corporate successor graphs into an ultimate parent node.
Instruction-tuned agent model for traversing corporate relationships and synthesizing lineage narratives.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Successfully calculates the terminal ultimate parent entity from a multi-hop predecessor chain.
- Accurately traverses split events and determines which branch retains the primary operating lineage.
- Emits an exportable graph chronology payload showing the exact path to the ultimate parent.

## Starter Examples
```json
[
  {
    "input": {
      "target_lei": "1234500T96DYXUPKV304",
      "historical_depth_years": 5
    },
    "expected_output": {
      "target_lei": "1234500T96DYXUPKV304",
      "ultimate_parent_lei": "9999500T96DYXUPKV304",
      "lineage_steps": 2,
      "chain_status": "complete"
    }
  },
  {
    "input": {
      "target_lei": "89450000000000000001",
      "historical_depth_years": 10
    },
    "expected_output": {
      "target_lei": "89450000000000000001",
      "ultimate_parent_lei": null,
      "lineage_steps": 1,
      "chain_status": "broken"
    }
  }
]
```

## Safety
Maintains non-accusatory corporate structural analysis without making definitive sanctions or freeze rulings.
Use mock external writes. Require human review before any real deployment.