Katkat

Distinguish AI Skills, Agents, LangChain, and LangGraph

J.P. MorganSoftware Engineer II · Onsite

Last updated

This question tests the architectural understanding of modern LLM-based application frameworks and the distinctions between modular AI components, task-oriented agents, and multi-agent coordination systems.

The Problem

You are tasked with building an automated financial document analysis system for a banking client. The system must categorize documents, extract key entities, and perform complex reasoning across multiple files. Your manager asks you to clarify the architectural trade-offs between implementing this as a series of "AI Skills" versus using a multi-agent orchestration framework.

Requirements

  1. Conceptual Distinctions: Define and differentiate between the following:

    • AI Skills: Atomic, deterministic functions (e.g., a summarizer or entity extractor).
    • Autonomous Agents: Systems that use an LLM as a controller to make decisions, use tools, and iterate toward a goal.
    • LangChain vs. LangGraph: Explain the fundamental shift in control flow from Directed Acyclic Graphs (DAGs) to cyclic state machines.
  2. Architectural Comparison: Contrast the use of LangChain (often sequence-based) with LangGraph (state-based) across the following dimensions:

    • Durable State Management: How is the conversation or task memory maintained?
    • Workflow Control: How do you enforce loops vs. linear sequences?
    • Failure Recovery & Persistence: How do you resume a task after a node failure?
    • Human-in-the-Loop (HITL) & Stop Conditions: Where and how can an agent be forced to pause for manual approval or context injection?
  3. Evaluation Strategy: How would you define "success" for a multi-agent system compared to a single-step AI skill?

Hints

Hint 1

Consider AI Skills as functional blocks with defined inputs and outputs, while Agents act as agents of choice with feedback loops.

Hint 2

Think of LangChain as an execution pipeline (a DAG) and LangGraph as an engine that manages a shared state and allows for iterative processing via cyclic graphs.

Hint 3

When discussing persistence, note that LangGraph inherently supports 'checkpoints' which allow the agent state to be saved and restored at any step, unlike stateless chains.

Follow-up questions

  • In a high-security banking environment, how would you implement granular permissions for tools accessed by an autonomous agent?
  • How does the latency of a multi-agent system compare to a single-step model chain, and how would you optimize for performance?
  • If an agent enters an infinite loop, what architectural mechanisms can be implemented at the graph level to terminate or penalize the process?