Zanist - Jurisprudence AI

Role

Full-stack Development

Year

2026

Tools

Next.js, AI API

Zanist - Jurisprudence AI

Zanist - Jurisprudence AI

Zanist is an AI-powered search tool for Swiss case law. It addresses a concrete problem: exact keyword search often fails because users don't know the precise legal terminology, especially since Swiss federal law is bilingual (French/German). The tool translates a plain-language factual description into the right legal terms, searches across several levels of semantic proximity, and ranks results by real relevance rather than exact word matching.

Context

Objectives

  • Enable natural-language search of case law instead of relying on exact legal keywords.
  • Cover all Swiss courts, both federal and cantonal, rather than the Federal Supreme Court alone.
  • Return results progressively rather than all at once, reassuring the user while the search is running.

My role

  • Full-stack Development: solo design and development of the entire application, from AI integration to deployment.
Zanist - Jurisprudence AI

Process

Research & Inspiration

  • Developed directly for a practicing lawyer, based on their real needs and usage feedback throughout development.

Feature Definition

  • Semantic enrichment via AI (Claude Sonnet): turns the query into 5 levels of bilingual FR/DE terminological proximity, with legal domains and potential articles.
  • Progressive federated search on entscheidsuche.ch, queried level by level in parallel batches, with a composite scoring system (relevance 45% / domain 35% / date 20%) and deduplication.
  • Direct detection of explicit ATF references, bypassing AI enrichment for an instant exact-match search.
  • Dynamic canton/court filters, with a cached hierarchy.
  • Streamed contextual summary: retrieves the full text of the selected ruling and generates a summary focused on the user's question.
  • Server-Sent Events instead of plain JSON, so the legal context appears before the results.

Development

  • Built with Next.js (App Router), React, TypeScript and Tailwind CSS, as a stateless application with no database.
  • Major data-source pivot mid-project: dropped HTML scraping of search.bger.ch, which was fragile and limited to the Federal Supreme Court, in favor of the structured entscheidsuche.ch API, which also covers cantonal courts.
  • Built-in fallback without AI: if the API call fails, naive keyword extraction takes over so the service stays usable.
  • Smart freshness filter: search first restricted to rulings from 2018 onward, with automatic fallback if no results are found.
  • Architecture designed for serverless hosting, with strict timeouts and regions close to Switzerland.
Zanist - Jurisprudence AI

Conclusion

Challenges

  • Fragility of the initial data source, HTML scraping of search.bger.ch, with inconsistent title formats and intermittent server errors, which required a full technical pivot to a structured API mid-project.
  • Designing a multi-criteria composite scoring system to rank results by real relevance rather than simple keyword matching.
  • Handling two very different case-number formats, federal and cantonal, and two different response formats from the external API — a sign of a poorly documented third-party API.

Results & Learnings

  • Fully working end-to-end pipeline: from a natural-language question to an AI summary of the selected ruling, passing through up to 5 levels of bilingual semantic search and around sixty scored, deduplicated candidate rulings.
  • Expanded coverage from the Federal Supreme Court to all Swiss cantonal courts, with dedicated filtering.
  • Direct recognition of official ATF references, offering an exact-search shortcut alongside semantic search.
  • Tool developed and validated with a real lawyer user, based on their usage feedback.