Elicon
← ALL REFERENCE ENGAGEMENTS
REFERENCE ENGAGEMENT
Legal

Cited Knowledge Base for a Law Firm

Turn decades of briefs and contracts into answers that always cite the exact paragraph.

  • Python
  • FastAPI
  • Anthropic
  • pgvector
  • Postgres

Reference engagements illustrate how Elicon would approach a project of this kind — the problem, the architecture and the decisions. They are examples, not accounts of past client work.

THE SITUATION

The problem.

A firm whose precedent lives in a document management system and in the memory of its longest-serving associates. The engagement turns the archive into a searchable knowledge base where every answer resolves to the paragraph it came from, and an uncited answer is structurally impossible.

Finding precedent depends on knowing it exists. Research is slow, inconsistent and hard to audit.

  • ·Search covers filenames and metadata only, so the archive is only as useful as the people who remember it.
  • ·Consumer AI tools produce fluent, confident, wrong answers, and a firm's tolerance for anything that cannot show its sources is rightly zero.

APPROACH

How we'd run it.

  1. 01Ingest the archive with chunking that preserves clause and paragraph boundaries, so citations resolve exactly.
  2. 02Use long-context synthesis with a schema that requires a passage reference for every assertion.
  3. 03Let partners flag bad answers, and tune retrieval against those flags.
  4. 04Put everything behind single sign-on, matter-level permissions and a full audit log.

ARCHITECTURE

What gets built.

Ingestion & OCR

A watcher on the document system, OCR for scanned material, then structural parsing. Every chunk keeps a pointer to document, page and paragraph, so a citation is a location rather than a guess.

Structure-aware chunking

Chunking follows numbered clauses, defined terms and schedules instead of a fixed token window, with parent-clause context attached so a subclause is never read in isolation.

Retrieval & synthesis

pgvector retrieval filtered by matter type, jurisdiction and date, then a synthesis pass that must quote before it concludes. Responses that fail schema validation are regenerated, never shown.

Access & audit

Single sign-on, matter-level permissions mirrored from the document system, and an append-only log of every query, document surfaced and answer produced.

DECISIONS

The trade-offs.

Long-context synthesis over aggressive summarisation

Legal reasoning depends on surrounding language. Pre-summarising chunks destroys exactly the nuance that makes an answer correct.

TRADE-OFFHigher token cost per query, which is small next to the cost of a lawyer's hour.

Structured output with mandatory passage references

Asking a model to cite is a suggestion. Rejecting any response without a passage reference per assertion is enforcement.

TRADE-OFFOccasional regeneration and slightly stiffer prose — stiff and sourced beats fluent and unverifiable.

Mirror existing document permissions rather than invent a new access model

Matter-level confidentiality already exists and is already audited. A second permission model creates two sources of truth.

TRADE-OFFA sync dependency, so permission changes propagate with a short delay.

STACK

Typical stack.

BACKEND
PythonFastAPIPostgres
AI
AnthropicpgvectorStructure-aware chunkingStructured outputs
INGESTION
OCR pipelineDocument system watcherConfidence scoring
SECURITY
SSOMatter-level ACLsAppend-only audit log

Work of this shape usually runs as AI Product Launch →

SIMILAR PROBLEM?

Tell us what you're dealing with.

One conversation with an engineer is usually enough to tell whether this is a few weeks of work, a few months, or something you shouldn't build at all.

Talk to an engineer →