BLOG

What’s a Legal Context Graph, and Why Do Legal AI Agents Need One?

New ui screenshot
Scott Kelly avatar

Scott Kelly

Vice President of Product and AI Strategy

For years, law firms and legal teams have lived with a knowledge problem hiding in plain sight.

A new associate joins a complex matter and spends days reconstructing context that already exists somewhere in the firm. A partner asks whether the firm has handled a similar issue before, and the answer depends on who happens to be in the room. A senior lawyer retires, and decades of judgment, precedent, and practical knowledge become harder to reach. 

AI changes the equation. Lawyers are no longer the only consumers of legal knowledge. AI assistants, agents, and emerging autopilots now need to work with that knowledge too. And an agent that cannot reach the right context is working blind.

Legal AI has a context problem.

The next layer of legal AI is not another chatbot. It is a governed legal context layer: a structured, queryable, permission-aware representation of the matters, documents, people, communications, activity, and legal concepts that make up the firm’s institutional knowledge.

What is a legal context graph?

A legal context graph is a live, governed map of legal work. It connects the documents in a firm with the matters they belong to, the people who worked on them, the communications around them, the activity that changed them, the legal concepts inside them, and the permissions that control who can use them.

That matters because lawyers do not think about work as isolated files. They think in matters, parties, issues, clauses, timelines, witnesses, negotiations, strategy, precedent, and risk. AI agents need to reason from the same context if they are going to be useful.

Note that where traditional knowledge graphs connect entities and relationships, a context graph adds real-time legal context: what is happening now, what changed recently, who has access, what policies apply, and what an AI agent or lawyer needs before acting.  

The simpler analogy is a static map versus a real-time navigation system. A static map shows the roads and intersections. A navigation system knows how things are connected. A navigation system knows where you are, what route is available, what traffic or roadblocks exist, and what has changed since the last time you looked.  

A document management system has traditionally answered an important question: where is the document? A legal context graph answers a different one: what does this work mean, how is it connected, what matters right now, and what is this person or agent allowed to know?

The three foundations of a legal context graph

The foundations of a legal context graph define how legal work moves from static documents and fragmented knowledge into a structured, connected system that improves how lawyers find information, understand matters, and apply AI effectively.

1. Documents become structured legal data

Legal documents without structure are a wall of text. Drop a legal AI agent into a matter with hundreds or thousands of unstructured documents, and it has to read its way into understanding every time it is asked to help. A human reviewing the output pays the same cost in reverse.

AI Profiling changes that. Instead of treating documents as static files, the system extracts the legal facts and concepts that make them useful: effective dates, governing law, jurisdiction, parties, counterparty, judge, clause types, obligations, renewal terms, termination rights, and whatever practice-specific fields a firm needs.

2. Search works by meaning, not just keywords

Keyword search still matters. Party names, case numbers, statute citations, and defined terms require precision. But keyword search alone cannot retrieve legal meaning when the words change.

The better approach is hybrid search. For lawyers, that means searching the way they think. For legal AI agents, it means retrieving the right context without flooding the prompt with irrelevant material. Better retrieval means less context pollution, fewer missed precedents, and more useful AI output.

search by meaning

3. The matter becomes more than a folder of documents

Today, much of that context is scattered across documents, emails, spreadsheets, notes, time entries, audit trails, and lawyers’ memories. The context graph brings those pieces together as queryable nodes and relationships above the document foundation.

For a legal AI agent, this changes the economics of the work. Without the graph, every agent invocation starts by rebuilding context from scratch. With the graph, the agent can begin from the matter’s structure and move efficiently to the information that matters.

matter overview

Why context has to persist beyond a session

Legal work is cumulative. The most important context may come from a prior matter, a redline from six months ago, an email thread, a partner’s earlier decision, an ethical wall, or a client guideline that changed last night. Uploading a few documents into a session does not solve that problem.

A legal context graph is different because it lives where the work already lives. It is built into the system of record, connected to the firm’s institutional knowledge, and governed by the same permissions, ethical walls, and client restrictions that govern the work itself.

Challenges of building a legal context graph

To make a legal context graph useful, the platform has to extract structure from unstructured documents, index content for both exact and conceptual retrieval, connect records across matters and communications, enforce governance in real time, and make the result available to both lawyers and AI agents without creating uncontrolled copies of the firm’s data.

That is why NetDocuments worked closely with AWS and Elastic on the infrastructure required to index, retrieve, and connect legal context at legal scale. The challenge is not merely building a demo that works on a small corpus. The challenge is making it work across the governed, high-volume, high-stakes reality of modern legal practice.

Built for legal scale means more than storing more documents.

It means extracting structure from unstructured legal language, combining lexical and semantic retrieval, connecting matters and communications, enforcing permissions at query time, and making the result usable by lawyers, agents, and emerging autopilots without creating uncontrolled copies of firm data.

The hard part is not drawing the graph. The hard part is keeping it live, governed, useful, and fast enough for the way legal work actually happens.

Why NetDocuments is positioned to build it

A legal context graph cannot be bolted onto legal work from the outside. It has to live close to the documents, matters, permissions, activity, and workflows that already define how the firm operates. 

That is why the system of record matters. NetDocuments already sits where legal work product is created, stored, secured, searched, governed, and reused. The platform knows the documents. It knows the matters. It knows the permissions. It knows the activity around the work. And with AI Profiling, concept-based search, matter context, and governed access through MCP, that foundation becomes usable by both lawyers and agents. 

The strategic point is simple: many AI experiences will begin to look similar at the surface. The quality of the work they produce will depend on the context layer underneath. A drafting assistant, research agent, workflow tool, or autopilot is only as good as the legal context it can reach, and only as safe as the governance it honors. 

What this unlocks for lawyers and agents

A legal context graph changes how lawyers and AI engage with a matter, shifting from piecing together scattered information to starting with a coherent, connected understanding of the work at hand.

Every matter starts with context

A second-year associate is staffed on a contract dispute heading to mediation. Today, she may spend the weekend reconstructing the matter: parties, posture, issues, documents, recent communications, and what the partner thinks matters.

With a legal context graph, the matter overview is already there. Not as a static summary, but as a connected view of the matter: parties, timeline, key documents, claims or issues, recent activity, and the people who have done similar work before. The associate still exercises judgment. She just starts from context instead of a blank page.

Search matches the lawyer’s mental model

An M&A partner may not remember the deal name. He remembers the business issue: a tipping basket that flips to first-dollar recovery, negotiated on the company side, in the last sixteen months. The context graph lets search use the concepts, metadata, and matter relationships together, so the system can return the relevant precedent instead of forcing the lawyer to remember the exact words.

Institutional knowledge becomes reachable

Firms have tried to capture institutional knowledge for decades. The problem is that knowledge systems separated from the work tend to decay. The context graph reverses the geometry. The knowledge is built from the work itself: the documents, matters, communications, activity, and outcomes that already live in the system of record.

When a senior lawyer retires, not everything she knows can be captured. Judgment is still judgment. But the matters she shaped, the clauses she negotiated, the strategies she chose, and the work product she left behind can become easier to find, understand, and reuse.

Agents can do more than answer isolated questions

An agent that receives only a few uploaded documents can summarize those documents. An agent connected to the firm’s governed context can do more useful work: find relevant precedent, identify the right starting point, compare a draft against the firm’s playbook, surface related communications, or explain what changed in a matter since the user last looked. That same foundation is what makes autopilots possible: longer-running, multi-step workflows where agents do not simply answer a question, but help move legal work forward over time with the right matter context, permissions, and guardrails in place.

The system of record becomes a system of understanding

For 30 years, legal technology has done a good job storing what lawyers did. The next chapter is about understanding the work well enough to help lawyers do what comes next.

That does not mean replacing legal judgment. It means reducing the friction around context so lawyers can spend more time on judgment, advocacy, negotiation, strategy, and client counsel.

The legal context graph is the foundation for that shift. It turns the system of record into a governed source of institutional knowledge that lawyers and AI agents can use together. It makes the work more findable, more connected, more reportable, and more ready for the agentic workflows that are beginning to arrive.

The future of legal AI will not be won by the tool with the biggest prompt box. It will be won by the platform that can deliver the right legal context, with the right governance, when the work is happening.

FAQs

What is a legal context graph?

A legal context graph is a governed, queryable representation of a firm’s legal work. It connects matters, documents, communications, people, activity, extracted legal concepts, and permissions so lawyers and AI agents can work from the full context of a matter rather than isolated files or one-off uploads.

How is a context graph different from a knowledge graph?

A knowledge graph connects entities and relationships. A context graph adds real-time legal context: what is happening now, what changed recently, who has access, what policies apply, and what an AI agent or lawyer needs before acting.

Think of it like looking at a static map versus a real-time navigation system. A static map shows the roads and intersections. A navigation system knows how things are connected: where you are, what route is available, what traffic or roadblocks exist, and what has changed since the last time you looked.  

How does AI Profiling support a legal context graph?

AI Profiling turns unstructured documents into structured legal data. It extracts classifications, metadata, clauses, dates, parties, jurisdictions, obligations, and other legal concepts that can be connected across matters, search, reporting, and agent workflows.

Why do AI agents need a legal context graph?

AI agents need context to do useful legal work. Without it, they reconstruct the matter from scratch or rely on whatever a user uploads. With a legal context graph, agents can retrieve the right matter context, precedent, activity, and constraints under the firm’s existing governance model. It also creates the foundation for autopilots: longer-running, multi-step workflows that can help move legal work forward over time while respecting the firm’s governance model.

Why is this hard to build for legal?

Legal data is massive, nuanced, mostly unstructured, and permission-sensitive. A legal context graph has to combine extraction, semantic and lexical retrieval, matter modeling, activity intelligence, and real-time governance across millions or hundreds of millions of records.

Why does NetDocuments matter in this shift?

The context layer is most useful when it lives where legal work already happens. NetDocuments is the system of record for legal work product, permissions, matter context, and activity, which makes it a natural foundation for governed AI and agent workflows.

How does governance work?

Governance must be enforced at the context layer. Each request should honor the current identity, permissions, ethical walls, client restrictions, and matter policies at the moment the user or agent asks for information.