Skip to content

API Reference parrot_tools.legal.librarian.agent

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.legal.librarian.agent

View source

LegalLibrarianAgent — the single LLM node of the retrieval DAG (FEAT-449 §3 M6).

The system cannot assert anything about the corpus without a
verifiable span reference; without a citation, the answer is
"no encontré". (R2)

This agent NEVER emits span offsets. It emits a DraftAnswer — payload keys copied from the enumerated dossier plus verbatim quotes — and the downstream SpanVerifier (TASK-2495) is what turns that draft into a sealed, span-verified LegalAnswer. The agent itself is read-only (no tools mounted) and stateless (no conversation memory): every draft() call is a single, independent structured-output request.

Alias DraftAnswer

Re-exported from parrot_tools.legal.librarian.models.DraftAnswer.

Attribute LIBRARIAN_SYSTEM_PROMPT

Class LegalLibrarianAgent

Read-only, memory-less librarian agent — the flow's only LLM node.

The system cannot assert anything about the corpus without a
verifiable span reference; without a citation, the answer is
"no encontré". (R2, verbatim)

Mounts no tools (read-only — retrieval happens entirely in the deterministic ToolNode stages around this agent, TASK-2496/2497) and uses no conversation memory (every draft() call is stateless, independent of prior turns).

Parameter Type Default Description
*args ()
**kwargs {}

Attributes:

Attribute Type Description
agent_id str
temperature float

Method LegalLibrarianAgent.agent_tools

Return this agent's tools — always empty (read-only, R1/R5).

agent_tools()

Method LegalLibrarianAgent.draft

Produce a structured draft answer for one librarian flow turn.

A single, stateless structured-output call — no conversation history is used or persisted.

draft(enumerated_dossier: str, query: str, as_of: date) -> DraftAnswer

Parameter Type Default Description
enumerated_dossier str The prompt-formatted dossier of retrieved payloads (dossier_build stage output), enumerating the ONLY valid payload_key values for this turn.
query str The user's original query.
as_of date The date resolved for this turn (stated back to the model so it can reason about validity windows).

Returns: DraftAnswer — The LLM's structured DraftAnswer — payload keys and verbatim quotes only, never offsets.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally