Skip to main content
Glama

Precedent

A retrieval-first contract-intelligence agent, architecturally modeled on DeepJudge's platform: a permission-aware hybrid search index, reusable Agent Skills, a verifying agent loop, and an MCP server so any MCP client (Claude Desktop, Claude Code, a browser chat) can use it. Domain data is public — the CUAD dataset (510 commercial contracts, 13k+ expert-labeled clauses, CC BY 4.0) plus SEC EDGAR filings — so it's safe to build, demo, and put in a portfolio.

Architecture

CUAD + EDGAR --> ingest (clause-aware chunking, taxonomy tags)
             --> hybrid index (Postgres + pgvector: vectors + keywords + access_group)
             --> 3 Agent Skills (find-precedent / negotiation-check / risk-flag)
             --> agent harness (Claude: route -> retrieve -> verify -> cite -> log)
             --> MCP server --> Claude Desktop / Claude Code / web chat
                              (governance & eval log runs alongside every step)

Why each layer exists is explained in CLAUDE.md. Read that before making changes — it's the project's memory, not just a config file.

Related MCP server: US Federal Procurement MCP

Prerequisites

  • Python 3.11+

  • Docker (for local Postgres + pgvector)

  • An Anthropic API key (console.anthropic.com)

  • A Voyage AI API key (dash.voyageai.com) — the first 50M tokens on voyage-law-2 are free, which covers this entire corpus many times over

Setup

# 1. Environment
cp .env.example .env
# edit .env: add ANTHROPIC_API_KEY and VOYAGE_API_KEY

# 2. Local database
docker compose up -d
python scripts/init_db.py          # applies db/schema.sql

# 3. Dependencies
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# 4. Verify the scaffold before touching data
pytest tests/ -q

# 5. Ingest data (takes a few minutes; well inside free API tiers)
python scripts/ingest_cuad.py

# 6. Evaluate retrieval quality against CUAD's own labels
python eval/run_eval.py

# 7. Run the MCP server
python -m src.precedent.mcp_server

License note

CUAD is CC BY 4.0 (free for commercial and non-commercial use). SEC filings are public record. No confidential data is used anywhere in this project.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      A
      maintenance
      Enables searching and filtering federal contract opportunities by keyword, agency, set-aside, NAICS, and more from any MCP client. Analyzes solicitations for small-business fit and risk, and provides reference lookups for NAICS codes, set-asides, and federal thresholds.
      9
      MIT
    • F
      license
      A
      quality
      C
      maintenance
      Enables LLM agents to query a contract data room using structured metadata filters and BM25 full-text search over contract articles, returning relevant contracts, justifying clauses, and explicitly excluded unknowns. It supports exhaustive list answers and citation-ready JSON for MCP clients.
      2
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query live pricing, resale, company KYC, SEC filings, patents, trademarks, public tenders, auctions and related market intelligence through MCP, returning clean typed JSON from primary sources on a pay-per-result basis.
      MIT