Practicing LLM Agents for Knowledge-Intensive Work
This article explains why knowledge-intensive tasks need multi-step agents rather than single-turn generation, and how to structure planning, retrieval, memory, reasoning, evaluation, and deployment so large models become auditable, tool-using workflows.
Why knowledge-intensive work needs agents
Tasks such as interpreting research reports, comparing contract clauses, and planning learning paths are rarely one-shot Q&A. They are multi-step, revisitable processes that call external knowledge and tools. Single-turn generation often fails on broken evidence chains, inconsistent policy language, and calculation errors. Task-oriented agents make the loop explicit: understand the goal, decompose steps, retrieve and compute, then verify and deliver—turning model capability into a monitorable workflow.
For developers, the core is not stacking prompts. It is splitting cognition, knowledge augmentation, and complex reasoning into replaceable modules: a planner for goals and constraints; an executor bound to retrieval, code, and spreadsheet tools; memory and knowledge layers for consistent terminology; a verifier for numbers, citations, and compliance. Enterprises care about auditability, replay, and least privilege—not only chat quality.
From intent to an executable plan
General cognition starts by turning vague requests into verifiable plans. Typical practice: specify deliverable shape (report, table, code patch), constraints (regulatory language, data scope, deadlines), and success criteria (error thresholds, citation completeness). Plans should be short and executable, not “analyze, then analyze again.”
Structure the plan as a step graph: each step names inputs, tools, output schema, and fallback. For example, “reconcile contingent liabilities in financial-statement notes” should name source fields, formulas, and exception handling. Keep planner and executor separate so plan quality can be scored alone and the model cannot quietly change the goal mid-run.
For multi-role work, use a coordinator with specialist sub-agents: retrieval extracts evidence, computation does deterministic math, writing handles wording. Grant permissions on a least-privilege basis so one tool call does not dump extra sensitive fields.
Knowledge: retrieval, memory, and policy governance
The usual failure is that the model “sounds right” but not in the organization’s language. Knowledge augmentation is not naive vector search. Turn policies, product manuals, and historical cases into citable evidence and require sources at generation time.
Layered memory is more stable: short-term session state for the current task; business memory for customer or case context; an organization knowledge base for normative text. Combine keyword and semantic retrieval, and filter by recency and legal status (in force vs. repealed). A fixed citation form—“clause ID + original excerpt + interpretation”—helps human sampling.
Govern policy with versions: slices carry effective dates and owners; changes go through review; stale content is down-ranked. On conflict, prefer higher authority and newer text, and surface the conflict instead of silently choosing. Store originals in object storage, slices in the search index, and every citation in logs for later accountability.
Complex reasoning: calculation, code, and long chains
Business reasoning is often a long chain: locate a clause, apply a formula, then check exceptions. Pure text chain-of-thought drops constraints in the middle. Formalizable parts belong in code or a rules engine: rates, tax, date diffs, and set operations are deterministic; the model maps natural language to parameters.
Code for agents must be sandboxed: restrict network, filesystem, and runtime; statically scan generated scripts; schema-check results before write-back. Long context can hold many documents at once, but cost and noise grow with it. Prefer “retrieve to shrink the set, then expand attachments on demand,” keeping the window for evidence the current step actually needs.
Sparse-activation architectures (large total parameters, relatively small activation per request) trade throughput and quality by activating only some experts. Adoption depends on latency budget and hardware. Extending context from hundreds of thousands of tokens mainly reduces splitting and lost cross-document references; evaluate effective use of length, not the nominal window.
Evaluation: closed-loop tasks, not leaderboards
Public benchmarks are a reference, not business acceptance. Build sets by task type: multi-hop QA by evidence coverage; math and code by executable pass rate; professional text by citation accuracy and missed-compliance rate. Also log average generation length, tool-call count, and retries so high scores do not hide token waste.
Quality gates can be layered: offline regression, shadow traffic, human review of high-risk classes. Alert on timeouts, tool failure rate, and missing citations. Deploy inference and tools on containers; logs and tracing should stitch one user request so you can tell whether planning, empty retrieval, or over-strict verification failed.
Deployment and cost
Production must meet latency, cost, and accuracy together. Lower-bit quantization (mixing higher-precision floating point and integer formats) reduces memory and bandwidth, but calibrate on business data—especially long-tail terms and numeric precision—not only general perplexity. Model–chip co-optimization (compilation, operator fusion, KV-cache policy) often beats swapping GPUs. The target is lower tokens and latency per task at acceptable accuracy loss, not a lab headline.
Security is part of the agent base: tool auth, data redaction, prompt-injection defense, and output filters. In finance and legal settings, encode “do not invent statutes; do not replace professional advice with definitive legal conclusions” as system policy, not only as prompt text.
A practical rollout path
Start with one measurable closed loop (for example, extract key contract clauses plus a risk list). Finish tools, knowledge, and verification on that path, then copy the pattern to tutoring Q&A, research summaries, and similar work. Evolve planning, execution, knowledge, and verification separately so a single monolith prompt does not become unmaintainable. Object storage, containers, logging, and monitoring provide observability and elasticity; the agent itself should stay focused on business semantics.
The value of agents is embedding LLM cognition in a governable execution system: compute what must be exact, cite what must be complete, and stop when the process should stop. Treat architecture, evaluation, and deployment as one problem—closer to a sustainable production system than chasing a single model talking point.
