The Chain Reaction

How LegalChain steps through a strictly defined sequence of cognitive operations, from retrieval to synthesis.

Most legal AI benchmarks are "single-shot": you feed a question and get an answer. LegalChain is "chained." The runner executes a sequence of 10 distinct steps (S1-S10), where the output of each step becomes the context for the next. This mimics the actual cognitive workflow of a human lawyer.

The 10-Skill Pipeline

Pipeline (high level)
EU + RP S1 S2 S3 S4 S5 S6 S7 S8 S9 S10
Step
Operation
Context Added
S1
Issue Identification
Extracts the precise legal question from the prompt.
S2
Rule Extraction
Selects applicable rules from the ResearchPack.
S3
Authority Validation
Verifies that retrieved Cases remain good law.
S4
Fact Analysis
Applies rules to the facts of the instant case.
S5
Prediction
Predicts outcome based on analysis (pre-writing).
S6
Synthesis
Generates the final IRAC-format memorandum.

Chain Context

The "ChainContext" object is the spine of the execution. It accumulates state. S6 (Synthesis) cannot "see" the future, but it can see everything S1-S5 produced.

class ChainContext: eu: EvaluationUnit # The Task (Immutable) rp: ResearchPack # The Evidence (Immutable) results: Dict[str, StepResult] # Accumulating Memory def store(self, step_name, result): self.results[step_name] = result def history(self): return self.results.values()

Error Propagation

In a chain, failure compounds. If S2 (Rule Extraction) fails to find any rules, what happens to S6 (Synthesis)?

LegalChain uses Degraded Execution. If a step fails, the runner passes an empty or default value to the next step rather than crashing. This forces the model to attempt recovery—mimicking a lawyer who can't find a perfect case but must still advise the client.

However, Integrity Failures (S8) result in a zero integrity score and are flagged in scoring details. The run continues to completion to capture full diagnostic data.