Problem Solved:
Consumers often feel powerless when facing large corporations. Refund policies are hidden in long Terms & Conditions, and legal rights are buried in complex legislative documents. "Haq-Se" bridges this gap by providing an AI-driven "Consumer Rights Hammer" that instantly cross-references corporate promises with national laws (Pakistan & USA) to generate legally-backed demand letters.
Features & Workflow:
Context-Driven Search: Uses Elastic Agent Builder to trigger multi-step workflows. ES|QL Logic: Implements advanced ES|QL queries to handle complex data indexing across divergent schemas (Company policies vs. Legal Acts). Automated Legal Drafting: Synthesizes actionable_clauses from corporate data with official proof citations from legal indices to create professional dispute drafts. Jurisdiction Awareness: Dynamically switches between Pakistan Consumer Protection Acts and USA Federal Trade Commission (FTC) / UCC regulations based on user context. Elastic Features Used:
ES|QL (Piped Query Language):
Used for advanced filtering and data transformation (e.g., using TO_STRING and KEEP for schema normalization). Agent Builder Framework: To orchestrate tools and maintain reasoning state across multi-step interactions. Advanced Indexing: Managed NDJSON datasets for high-speed retrieval of specialized documents. Challenges & Learnings:
Schema Mapping:
One major challenge was joining indices with incompatible data types (Keyword vs. Text). I solved this using ES|QL's TO_STRING() function to normalize fields on the fly. Reasoning Accuracy: Fine-tuning the instructions to ensure the agent doesn't just "talk" but actually cites the "Proof" field as the primary legal evidence.
Built With
- elasticagent
- es|ql
Log in or sign up for Devpost to join the conversation.