Inspiration
Legal research is a demanding test for multi-agent AI. A fluent answer is not enough: a researcher needs to inspect the authorities behind it, understand where they came from, and see what the system actually checked.
We built Precedent for legal professionals preparing a first-pass research memo, and for developers who need an inspectable agent pipeline. The prototype focuses on Colorado legal research.
What it does
Ask a research question and Precedent retrieves opinion passages, expands related authorities through a citation graph, and drafts a short memo with references. A safeguard checks those references against the retrieved set and flags unknown authorities and potentially uncited claims.
The interface brings together the memo, source passages, a geographic citation map, agent activity, run history, and optional voice. A partner dashboard exposes pipeline and service metrics. Follow-up questions retain the research thread.
This is research assistance, not legal advice. A passing reference check does not establish legal correctness, current law, or that an authority supports every claim.
How we built it
The pipeline has four main agent roles: planner, retriever, answer, and safeguard.
- Daytona: hosts the application and agent execution in an isolated Linux sandbox.
- Octo: retrieves full-text opinion passages to identify seed cases. The configured live corpus contains approximately 804,000 passages, with a snapshot fallback.
- SurrealDB: expands incoming and outgoing citation relationships around the seeds. The graph contains approximately 120,000 authorities and 160,000 citation edges; ranking incorporates citation importance.
- Anthropic Claude Haiku: drafts the memo from the retrieved context.
- Arize: receives OpenTelemetry traces for the agent stages and evaluations for citation checks and a heuristic groundedness measure.
- ElevenLabs: supplies speech output for the memo and guided exploration.
- ACS: provides agent coordination, task claims, handoffs, and audit records. We adapted the existing open-source ACS stack for the Daytona environment.
The application uses Python and browser-based JavaScript. Caching, request limits, hourly provider caps, and an explicitly labeled template fallback keep the demo usable when a provider is unavailable or a limit is reached.
Challenges we ran into
The hardest part was keeping retrieved passages, graph nodes, answer references, and visible source links consistent across the pipeline. Graph expansion can surface highly connected authorities that are less relevant to the question. Search quality also varies with the wording of a query and the available passage source.
We also had to coordinate several agents in a shared sandbox and connect model access, tracing, and voice without exposing credentials in the frontend.
Accomplishments we're proud of
We connected passage retrieval, graph traversal, memo generation, reference checks, traces, and voice into one inspectable workflow. Researchers can move from an answer to its sources and geographic context, while developers can inspect the same run through activity records and service metrics.
The demo makes the limits of its safeguard explicit instead of equating a matched citation with a legally correct answer.
What we learned
Retrieval quality and traceability matter as much as generation. A citation graph provides useful context, but graph importance is not the same as legal relevance. Each check needs a clear scope, and cached or fallback results need visible labels.
What's next for Precedent
Improve relevance evaluation, validate quotations and claim-to-source support, add checks for subsequent treatment and current law, and test the workflow with legal professionals. We also want to make it easier to reuse the pipeline with other source collections while retaining its provenance and audit trail.
Built With
- anthropic
- arize
- daytona
- elevenlabs
- javascript
- octo
- python
- surrealdb
Log in or sign up for Devpost to join the conversation.