Inspiration
In the era of global commerce, cross-border e-commerce (Amazon, TikTok Shop, Shopify DTC), and international tech expansion, trademarks are the foundational legal defense and intangible asset of every brand. However, conventional cross-border trademark clearance is severely constrained by industry bottlenecks:
- Slow & Expensive: Retaining foreign IP counsel for preliminary clearance typically takes 3–7 business days and costs \$200–\$1,500 per class per jurisdiction;
- High Multidimensional Complexity: Clearance spans visual spelling, cross-lingual phonetics, semantic concepts, figurative logos, and complex Nice Classification subclass overlaps;
- Black-Box LLM Hallucinations: Generic LLMs lack microsecond-level access to multi-million-record trademark registries and produce non-deterministic, hallucinated legal assessments.
Our inspiration was to build LexMorph—a dual-engine AI trademark legal-tech agent combining deterministic mathematical algorithms with agentic legal reasoning, turning days of manual clearance into sub-second, mathematically grounded, and multi-jurisdictional risk intelligence.
What it does
LexMorph is an autonomous AI trademark clearance, conflict avoidance, and registration success prediction agent tailored for global brands:
- Sub-Second Multi-Modal Cross-Jurisdiction Clearance: Integrates official registries from the USPTO (US), EUIPO (EU), and WIPO Madrid, conducting unified evaluations across text, phonetics, semantics, and figurative marks.
- DuPont 13-Factor Likelihood of Confusion Mathematical Model: Formulates judicial precedents (In re E.I. DuPont) and EUIPO examination guidelines into a quantifiable risk index $R_{\text{DuPont}}$: $$R_{\text{DuPont}}(M_q, M_c) = \min\left(1.0, \; \Big( w_1 S_{\text{text}} + w_2 S_{\text{phonetic}} \Big) \cdot \Big( 0.2 + 0.8 S_{\text{goods}} \Big) \cdot K_{\text{status}} \right)$$
- Predictive Registration Success Modeling: Calculates the probability of registration approval ($P_{\text{success}}$) via logistic regression combining distinctiveness spectrum scoring ($D_{\text{distinctiveness}}$) with maximum conflicting prior risk ($R_{\max}$): $$P_{\text{success}} = \frac{1}{1 + \exp\left( -\big( \theta_0 - \theta_1 \cdot R_{\max} + \theta_2 \cdot D_{\text{distinctiveness}} \big) \right)}$$
- Intelligent Brand Name Optimizer & Collision Avoidance: When high-risk conflicts are identified, the agent algorithmically morphs root morphemes, adjusts phonetic signatures, and generates distinctive, legally clear candidate names.
- Interactive White-Label Diagnostics via SSE Streaming: Streams clearance lifecycle milestones over Server-Sent Events (SSE), generating multi-dimensional radar charts, conflicting citations, and actionable prosecution strategies.
How we built it
We built LexMorph as a high-performance, modular, and memory-safe Rust monorepo:
lexmorph-core: Defines strict domain primitives, trademark lifecycle state machines, Nice taxonomies, and type-safe error boundaries.lexmorph-algorithms: Implements SIMD-accelerated string metrics (Jaro-Winkler + Levenshtein), Double Metaphone phonetic encoders, Nice goods/services Jaccard matrix calculators, and DuPont risk engines in pure Rust.lexmorph-connectors: Asynchronous, rate-limited connectors interfacing directly with USPTO, EUIPO, and WIPO endpoints with exponential backoff and circuit-breaking fallbacks.lexmorph-storage: Multi-engine hybrid persistence combining PostgreSQL +pgvectorfor dense semantic embeddings, Sled/RocksDB for hot local caching, and in-memory inverted indices.lexmorph-agent: Deterministic state machine orchestrating multi-agent deliberation and leveraging frontier LLMs (Gemini/Claude) for case-law synthesis.lexmorph-server: Axum-powered asynchronous HTTP engine providing REST APIs, OpenAPI specifications, and real-time SSE streaming.
Challenges we ran into
- Deterministic Legal Explainability vs. Black-Box Deep Learning:
- Challenge: Trademark prosecution requires granular, mathematically verifiable evidence, whereas raw neural networks act as opaque black boxes prone to hallucinations.
- Solution: Architected a two-tier system: a deterministic Rust mathematical foundation calculating exact similarities ($<1\,\text{ms}$, 100% explainable) coupled with an agentic synthesis layer interpreting quantified risks against case law.
- Cross-Lingual Phonetic Ambiguities:
- Challenge: Algorithms like Double Metaphone produce false-positive phonetic collisions across non-English transliterations.
- Solution: Enforced Nice Classification subclass overlap ($S_{\text{goods}}$) as an isolating gatekeeper, ensuring phonetic weights only penalize related trade channels.
- Microsecond Latency at Scale Across Millions of Records:
- Challenge: Scanning multi-million-record trademark datasets without latency bottlenecks.
- Solution: Optimized Rust memory layouts, zero-allocation buffers, and SIMD parallelism to achieve an end-to-end per-item comparison time of $< 3.5\,\mu\text{s}$ (>500,000 evaluations/sec per CPU core).
Accomplishments that we're proud of
- Microsecond-Level Performance: Achieved $< 3.5\,\mu\text{s}$ per trademark comparison in Criterion benchmarks on Apple Silicon / AMD EPYC.
- Strict Jurisprudential Alignment: Mathematically codified DuPont factors and EUIPO examination standards into quantifiable metrics.
- Sub-2-Second End-to-End Pipeline: Delivered a complete workflow—from name ingestion and multi-jurisdiction search to agentic analysis and SSE rendering—in under 2 seconds.
- Production-Grade Engineering: Developed 6 cohesive Rust crates with $>90\%$ test coverage, comprehensive CI/CD benchmarks, and zero-downtime containerized deployments.
What we learned
- Vertical AI Synergies: The ultimate architecture for specialized domains is not replacing classical algorithms with brute-force LLMs, but anchoring LLMs on top of lightning-fast, mathematically verifiable deterministic engines.
- Navigating Legal-Tech Boundaries: Operating in cross-border IP requires positioning AI as an objective statistical risk intelligence co-pilot rather than an unqualified legal counsel, building trust through transparency and mathematical rigor.
What's next for LexMorph
- Expanded Jurisdictions: Ingesting official registries from CNIPA (China), JPO (Japan), UKIPO (UK), and IP Australia.
- Multi-Modal Visual CLIP Logo Indexing: Integrating fine-tuned CLIP embedding models for sub-second image-to-image similarity matching on figurative marks.
- Global Filing Fulfillment Integration: Connecting directly with verified global IP attorney networks to enable seamless 1-click international filing.
- Continuous Brand Watch & Trademark Squatting Alerts: Launching webhook-driven monitoring to proactively notify brands of infringing filings worldwide.
Built With
- ai-agents
- axum
- css3
- docker
- double-metaphone
- euipo-api
- gemini-api
- html5
- jaro-winkler
- legaltech
- levenshtein
- multi-agent-orchestration
- multi-modal-ai
- openapi
- pgvector
- postgresql
- restful-api
- rust
- server-sent-events-(sse)
- simd
- tokio
- uspto-api
- vector-search
- wipo-madrid-system
Log in or sign up for Devpost to join the conversation.