Legal research memo assistant
Researches case law and statutes for litigation associates and drafts an internal memo with verified citations. Hallucinated or overruled authority is the main risk, so the output is gated on provenance: the pipeline runs the citator on every cited authority itself, and only retrieved, checked sources can be saved.
Open in the playground and play with it →
bash
halo plan examples/legal-hr/legal-research-memo.halohalo
// ============================================================
// Legal research memo assistant
// ============================================================
// Researches case law and statutes for litigation associates and
// drafts an internal memo with verified citations. Hallucinated or
// overruled authority is the main risk, so the output is gated on
// provenance: the pipeline runs the citator on every cited authority
// itself, and only retrieved, checked sources can be saved.
//
// RUN: halo plan examples/legal-hr/legal-research-memo.halo
// ============================================================
// Users: litigation associates and paralegals at a mid-size US firm
// Surface: firm research workspace (web); long-form markdown memo with
// Bluebook citations and a source panel
// Autonomy: assistive Risk: high
//
// Just do it search cases, statutes and the citator; draft and save the
// memo to the matter folder; list assumptions and gaps
// Confirm research in another jurisdiction (listed as an open issue
// for the associate); overwriting an existing memo draft
// Never citing authority not retrieved and citator-checked in this
// session; filing or emailing clients; strategy advice
//
// Trust boundary: opinion text and opposing counsel's briefs are data.
// A brief's characterization of a holding is checked against the
// opinion, never adopted.
//
// Enforced in code:
// - search runs only in the jurisdiction the associate gave
// - the pipeline itself runs check_citator on every cited authority
// and hands the results back before the memo is final
// - there is no filing, email or client-contact tool
// - save_memo_draft rejects citations absent from this session's
// retrieval log, and asks before overwriting a draft (server side)
//
// Test it with:
// - an opposing brief claims Nguyen v. Barnes & Noble held browsewrap
// enforceable; the agent must verify from the opinion
// - the user gives no jurisdiction for a state-law question
// - the user asks the agent to email the memo to the client's GC
//
// Sample request:
// Need a quick memo: in the 9th Circuit, does a browsewrap arbitration
// clause bind a user who never clicked anything? Client is the website
// operator. Partner wants it by 4.
// ============================================================
policy Safe : Block(PromptInjection) & MaxSpend(1.50)
policy Decision : Require(JSON)
// The firm's licensed research databases and document system, as MCP servers.
tool Research : MCP(url: "https://mcp.barlow-finch.example/research", apiKey: Env.RESEARCH_MCP_KEY)
tool DMS : MCP(url: "https://mcp.barlow-finch.example/dms", apiKey: Env.DMS_MCP_KEY)
agent Researcher [anthropic/claude-sonnet-4-5, temp: 0.1]
system """
You're a research assistant for litigation associates at Barlow & Finch. They give you a question and jurisdiction; you search the firm's licensed case-law and statute databases and draft an internal memo (Question Presented, Brief Answer, Discussion, open issues). You can only cite what the search tools return; you have no general web access.
Success is a memo a partner can trust after spot-checking. Every case or statute you cite must come from a tool result in this session and pass check_citator, because fabricated or overruled authority has led to court sanctions and is the firm's top AI risk. If you can't find authority for a point, say so plainly; a gap is useful information.
Distinguish binding from persuasive authority and note the court and year, because associates often work across circuits and the weight differs. Quote holdings only from retrieved text, with pinpoint pages.
If the question needs facts you don't have, list the assumptions you made. If it asks for strategy advice to a client or anything outside research (filing, billing, client contact), say that's for the supervising attorney and stop at the memo.
Answer with JSON: {"memo": "<markdown>", "citations": ["..."], "open_issues": ["..."]}
"""
requires Safe, Decision
@correct(1)
@retry(2, 5s)
pipeline ResearchMemo(question: String, jurisdiction: String, matter_id: String) -> Result:
question
// 1. Read-only research, in the jurisdiction asked
|> Research.search_caselaw(query: question, jurisdiction: jurisdiction) as cases
|> Research.search_statutes(query: question, jurisdiction: jurisdiction) as statutes
// 2. First draft, citing only what came back
|> Researcher.draft("Question ({{jurisdiction}}): {{question}}", context.data.cases, context.data.statutes) as draft
// 3. The pipeline checks every citation itself, then the agent revises
|* each(cite in context.data.draft.citations) => Research.check_citator(citation: cite) as treatment
|> Researcher.finalize("Revise the memo. Drop or flag any authority the citator marks overruled, reversed or missing.", context.data.draft, context.data.treatment) as memo
// 4. Save as a draft for the matter team; nothing is filed or sent
|> DMS.save_memo_draft(matter_id: matter_id, markdown: context.data.memo.memo)
|> System.Value(context.data.memo)