đź§  Inspiration

We realized that access to legal information, especially jurisprudence, remains limited or overly complex for the average citizen and small organizations. In Costa Rica, thousands of judicial rulings exist in public records, but they’re trapped in PDFs, obscure databases, or jargon-heavy texts. Our inspiration was to democratize that knowledge using AI agents trained on real jurisprudence, offering digestible, interactive insights — not just for lawyers, but for everyone.

We want to answer real-world questions like:

  • “Can I be fired without notice?”
  • “What have courts said about late tax filings?”
  • “What’s the legal precedent if a tenant stops paying rent?”

And more — in plain language.


🤖 What it does

Avii Law (working name) is a multi-agent AI system built on the Agent ADK framework that:

  • Ingests and analyzes legal rulings from Costa Rican courts.
  • Uses agents specialized in extraction, summarization, precedent-matching, and natural language simplification.
  • Provides interactive answers in plain Spanish.
  • Surfaces relevant precedents using semantic similarity (e.g., via Vertex AI + BigQuery vector search).
  • Can be queried via chat interface or API (ideal for embedding in government portals, law firms, or civic tech apps).

đź”§ How we built it

  • We started from Google’s Agent ADK Data Science sample and adapted it to legal NLP workflows.
  • Leveraged BigQuery for storing parsed and pre-processed legal documents (metadata, body, topics, outcomes).
  • Built 3 main agents:
    1. Data Ingestion Agent: Scrapes and parses legal rulings (PDFs, XML).
    2. Insight Agent: Tags decisions, extracts key clauses, identifies precedent chains.
    3. Answer Agent: Translates findings into digestible text using fine-tuned models.

⚠️ Challenges I ran into

  • Data Quality: Legal texts are inconsistent. Some rulings have formatting nightmares. Parsing them cleanly is a project in itself.
  • Bias and Generalization: Translating nuanced legal text into plain language without oversimplifying (or hallucinating) is risky.
  • Token Limitations: Many rulings are long. Chunking and context management was a big hurdle.
  • Agent Coordination: Using Agent ADK wasn’t plug-and-play. Agents needed custom memory management and a clear handoff protocol to avoid conflict or repetition.
  • Public Accessibility: Ensuring the output doesn't become legal advice while remaining useful for real people.

📚 What I learned

  • The ADK is powerful, but you need discipline in designing agent boundaries and roles.
  • Real-world applications need explainability and traceability, so every insight needs to be backed by a legal reference.
  • Legal data is messy and deeply contextual; generic summarization models are dangerous here.
  • Collaboration between agents requires more than prompts; they need context-persistent memory and role clarity.

What’s next for Avii Law

  • Court-specific models: Train sub-models per court or topic (labor, tax, civil).
  • Citation graphs: Visualize how precedents build on each other — a legal knowledge map.
  • Multilingual support: Translate rulings into English for academic, investment, and international audiences.
  • Policy dashboards: Let NGOs or ministries spot trends in rulings (e.g., rise in labor conflicts).
  • Open Source + API Access: Make Avii Law the civic tech legal backbone in LATAM.

Try it out

We’re deploying a limited version at [insert link], where users can:

  • Ask legal questions in natural Spanish.
  • Get summarized answers with precedent references.
  • Provide feedback to improve the accuracy and relevance.

Also accessible via WhatsApp for inclusive access: [insert number or demo]

Share this project:

Updates