The article
Query your table as a graph.Petabytes. Subsecond. No data movement.

An AI agent becomes useful for extended work when it can preserve progress, test its decisions, and continue toward an outcome across interruptions. Giving a model more time creates that opportunity; the surrounding architecture determines whether the time produces better work.
For enterprise analytics, this means delegating an investigation: the agent plans the analysis, queries data, checks the evidence, and chooses what to examine next. This article explains long-running AI agents, how that pattern becomes a long-running data agent, and the data infrastructure that makes sustained investigation practical.
What are long-running AI agents?
A long-running AI agent is a system that pursues an objective through repeated cycles of planning, tool use, observation, and revision while retaining enough state to continue the job. The objective survives individual model responses and, in a durable implementation, process restarts and pauses.
The user delegates an outcome. The agent chooses intermediate actions within defined permissions, checks their results, and updates its plan. Useful autonomy includes recognizing when evidence is insufficient and returning a partial result with a clear explanation of what remains unresolved.
What long-running actually means
Elapsed time alone is a poor definition. A database query can run for hours while executing a plan fixed at submission. An agent job may finish sooner while making many decisions that depend on newly observed results. The distinguishing property is continuity across those decisions.
Several kinds of duration can overlap. A job may exceed one context window, wait for an external service, pause for human input, or resume after a worker fails. The model does not need to remain continuously active. A scheduler can wake the job when the next result or approval arrives.
This architecture suits work whose next step depends on what the previous step reveals: implementing software, researching a question, or investigating an operational problem. Predictable sequences still suit ordinary workflows. Use an agent where interpreting intermediate evidence changes the path, and retain deterministic code for operations whose behavior is already known.
The architecture behind a durable agent job
The model operates inside an agent harness that manages context, tool execution, state, and control flow. A durable job also needs a persistent identifier, recoverable progress, resource limits, and an explicit completion condition. These responsibilities belong to the application around the model.
Memory serves different purposes at different lifetimes:
| Layer | What it holds | What it enables |
|---|---|---|
| Working context | Current instructions, relevant evidence, and the next decision | Reasoning within the present model call |
| Job checkpoint | Plan, completed steps, pending actions, and references to saved outputs | Resuming the same job after a pause or failure |
| Cross-job memory | Reviewed facts, preferences, and reusable knowledge with provenance | Carrying useful knowledge into later work |
LangGraph's persistence documentation makes a related distinction between thread-scoped checkpoints and stores shared across threads. It also warns that an in-memory checkpointer loses state when its process restarts. Persistence requires a backend that survives the failures the application is expected to recover from.
Store large artifacts outside the prompt and retrieve the relevant portions when needed. A checkpoint can identify an output file or query result without copying its entire contents into every model call. This keeps the next decision focused while preserving the evidence for later inspection.
Three challenges: memory, failures, and verification
Preserving useful progress. A conversation summary can omit an unresolved requirement or the reason an approach failed. Maintain explicit records of completed work, remaining work, decisions, and evidence. On resumption, load those records and check the environment before continuing. In Anthropic's November 2025 harness work, an initializer prepared the task environment and subsequent coding sessions made incremental progress while leaving structured artifacts for the next session. The transferable idea is a reliable handoff between periods of work.
Recovering without repeating harmful effects. Distinguish a transient timeout from an invalid request. Retry temporary failures within a budget; correct a malformed query before trying again. For external writes, the dangerous case is a successful action followed by a lost acknowledgement. LangGraph's fault-tolerance documentation explains that retrying a node does not make external side effects happen exactly once. Use a stable, durably recorded idempotency key where the receiving service supports deduplication, or reconcile the external state before repeating the operation.
Knowing when the job is complete. Completion needs observable acceptance criteria. A confident final message is insufficient evidence that requirements were met. Anthropic's March 2026 harness research separates planning, generation, and evaluation in a coding architecture and discusses the weakness of self-evaluation. For other domains, the corresponding engineering question is which checks can independently test the result: executable tests, evidence coverage, domain rules, or human review.
Bound the job even when it has not reached an answer. Track elapsed time, tool calls, spending, and repeated attempts that produce no new evidence. Define when to continue, wait, request input, or stop with an incomplete result. Expose these states so a person can redirect work without restarting the investigation.
Evaluate recovery as well as successful completion. Interrupt a job between steps and inspect what it does after resumption. It should preserve completed work, reconcile uncertain actions, and retain the original acceptance criteria. Long-running reliability is a property of the full execution path.
What are long-running data agents?
A long-running data agent applies that architecture to an analytical objective. Rather than following a predetermined sequence of queries, it can explore multiple hypotheses across datasets, test them against the evidence, and adjust its investigation as new findings emerge. The user provides the business objective, while the agent determines which analyses to perform until it can deliver a supported explanation or identify what remains unresolved.
This autonomy requires a consistent understanding of business entities and relationships. As the agent moves across datasets, its queries should follow an approved business model rather than inventing connections between records. Validating queries against that model helps keep the investigation grounded in the intended meaning of the data, even as the agent independently decides what to explore next.
From BI and text-to-SQL to autonomous investigation
In an analyst-led BI workflow, a person iterates on questions and develops explanations using dashboards, metrics, and other analytical tools. In a request-driven text-to-SQL workflow, that person frames a question and the system translates it into a query.
A data agent also decides which question should come next. The distinction concerns responsibility for the investigation, not the query language. SQL remains useful inside an agent, and a BI product can incorporate an autonomous investigation workflow.
| Responsibility | Analyst-led BI or text-to-SQL workflow | Long-running data-agent workflow |
|---|---|---|
| Choose the next analytical step | The person selects a view or asks another question | The agent proposes a step based on the objective and evidence |
| Follow an unexpected result | The person redirects the analysis | The agent updates its hypotheses and follows relevant data |
| Preserve progress | The person maintains continuity using saved queries, reports, and notes | The application persists findings, queries, and unresolved questions |
| Deliver the outcome | The person assembles an explanation with supporting evidence and limitations | The agent assembles an explanation with supporting evidence and limitations |
| Review the investigation | Validate results and the analyst's investigative choices | Validate results and the agent's investigative choices |
Delegating the investigation changes what the application must evaluate. Every query might be correct while the overall investigation remains incomplete. Evaluating a data agent therefore requires examining both its calculations and its choice of what to investigate.
How an agent investigates a missed sales target
Consider a sales leader who wants to understand why the team is missing its quarterly target. The question does not specify which datasets to examine or which analyses to perform. A long-running data agent must determine where to begin, investigate possible explanations, and decide what to examine next based on the evidence it finds.
The agent first separates fewer deals, smaller deals, and deals slipping into the next quarter. In this scenario, slipped deals explain much of the gap. It investigates shared characteristics, testing region, sales team, pricing changes, and competitor involvement. Those explanations do not account for the pattern.
The investigation then follows delayed products to their components and suppliers. A supplier delay emerges as a possible explanation. The agent tests that lead against similar products that do not use the same component and examines the timing of deliveries and deals.
The example illustrates how an agent can change its analytical direction as new evidence emerges. A sales question leads into supply-chain relationships because intermediate findings make that path worth investigating. The result remains a likely explanation supported by comparisons, with unresolved questions stated explicitly.
Finding a connected supplier does not establish causation. The investigation must assess timing, alternative explanations, and the suitability of its comparison group. A useful final report lets a person distinguish what the records show from what the agent infers.
Memory must preserve evidence and business meaning
For data analysis, a progress record should preserve the question tested, query and parameters, source scope, result location, and interpretation. Record whether a hypothesis is supported, contradicted, or still unresolved. Keep the evidence that caused its status to change.
This distinction matters across sessions. A compressed note that says a supplier caused the shortfall could turn a tentative hypothesis into an accepted fact. Retaining the comparison and its limitations gives the next session something concrete to reassess.
Time also belongs in the evidence. Record the reporting period and when data was read. If source records change during the job, later results may describe a different state of the business. Choose a consistency strategy appropriate to the source systems, and identify which findings need refreshing before the final report.
Business meaning requires its own durable representation. Deals, products, components, and suppliers need agreed identities and relationships. A knowledge graph can express those entities and connections in a form the agent can inspect and query. That model provides a reusable route through the data; the job checkpoint records where this particular investigation has been.
Use cases for sustained data investigation
Revenue investigations and supplier-impact analysis fit when an explanation crosses business functions, as the sales scenario illustrates. The useful output is an evidence-backed account of how the connected records bear on the original problem.
IT operations is another application. AMD uses AI agents to investigate operational issues by connecting information from IT tickets, knowledge bases, and other enterprise data. The agents can explore relationships across systems, evaluate their findings, and independently decide what to investigate next.
Across these use cases, sustained autonomy requires access to relevant evidence and a reliable understanding of its relationships. The agent needs a data interface through which it can continue exploring as the question develops.
How to build long-running data agents on enterprise data
Building a long-running data agent starts with an agent harness that manages planning, tool execution, memory, and recovery across sessions. The harness preserves investigation progress, including completed queries, supporting evidence, unresolved hypotheses, and next steps. It also defines execution limits and completion criteria, allowing the agent to resume its work after interruptions without losing the context of earlier findings.
The harness also needs a reliable way to access and investigate enterprise data. As the agent explores different hypotheses, it must understand business entities and relationships, execute queries, and use the results to decide what to investigate next. A consistent business model and efficient query execution help support this process.
PuppyGraph is a real-time, zero-ETL graph query engine that lets agents explore relationships across existing enterprise data with no data movement or duplication into a separate graph database. It is a distributed graph query engine over SQL databases, data warehouses, and data lakes or lakehouses, including direct reads of open table formats such as Iceberg and Delta Lake. A graph schema maps tables to nodes and edges, queried with openCypher and Gremlin, while the same tables remain available to SQL. Its built-in AI assistant can investigate complex questions by generating and running queries, examining results, and iteratively exploring related questions.

Build a knowledge graph over existing tables
Start with a business domain and the relationships its investigations require. In the sales scenario, that means deals, products, components, and suppliers. The graph model makes the connections available for exploration without requiring the team to predefine every analytical question.
Connect the relevant catalogs, then use the AI-assisted graph builder to inspect tables, sample rows, test candidate joins, and propose nodes and edges. Review the proposed model against the business meaning before approving it. Matching keys are evidence of a possible relationship; domain knowledge determines whether that relationship is appropriate.
The underlying records remain in the existing data platform. This makes the knowledge graph an additional way to query the business, with the graph schema defining how source records represent its entities and relationships.
Let the agent plan, query, and investigate
PuppyGraph's built-in AI assistant provides the agent behavior directly: a user asks a question, and the assistant can execute graph queries, examine results, and pursue related analyses toward an answer. The user does not need to supply every query or manually direct each step of the investigation.
For a custom long-running agent, PuppyGraph's open-source MCP integration exposes schema inspection and query execution, including returned rows, warnings, and errors. The application can put these tools inside its own planning and evaluation loop.
These are two adoption paths: use the built-in AI assistant to investigate through the product, or supply PuppyGraph as the data engine for an agent you build. For a custom job that must survive worker failures or wait overnight, provide durable scheduling, checkpoints, and budgets in that application's harness.
Ground each query in the approved model
The ontology defines the business entities and relationships the agent can query. PuppyGraph checks generated openCypher queries against that schema, helping the agent detect undefined labels, properties, and certain relationship-pattern mismatches before treating an empty result as evidence.
The execution behavior matters. Current schema-validation documentation specifies warnings by default and an opt-in strict mode that fails a query on a detected mismatch. For a custom agent that requires rejection before execution, enable strict validation for its openCypher queries and return the diagnostic to the agent. It can inspect the schema, repair the query, and retry within its budget.
This is ontology enforcement as part of the investigation loop. It helps correct model-reference errors; source quality and analytical judgment still need their own checks. A valid relationship can support an irrelevant hypothesis, and an approved model can contain a mistaken business assumption.
Enable fast graph queries for data agents
PuppyGraph compiles a graph query into a plan of node and edge operators that executes in its own distributed engine. Because the query is represented as graph operators end to end, the engine optimizes specifically for multi-hop traversals. Execution can run in parallel across compute nodes, allowing compute to scale independently of source storage.
This architecture enables efficient graph queries as data agents explore relationships across petabytes of enterprise data and up to 3,000 tables, with subsecond graph queries for supported workloads. Each result can guide the agent toward another traversal across the modeled entities. An agent can also use the existing SQL engine for filters, aggregates, and other analyses that fit it. The investigation chooses the appropriate tool for each question over the same underlying tables.



Conclusion
Long-running AI agents need continuity, recoverable execution, and verifiable outcomes. Long-running data agents add responsibility for the investigation itself: deciding what to query, testing explanations, and preserving the evidence behind each conclusion. Their usefulness grows when enterprise data is accessible through a reviewed model of the business and an engine that supports repeated exploration.
Try the forever-free PuppyGraph Developer Edition and book a demo with the team to see how openCypher and Gremlin queries follow business relationships across warehouse and lakehouse tables, with no graph-specific ETL, to support an agent's continuing investigation.





