Dike's four core MCP tools (dike_search, dike_reason, dike_cite, dike_graph_traverse) are engineered to compose seamlessly inside autonomous agent loops.
Rendering diagram...
Pattern 1: Exploratory Research & Hydration
Use this pattern when your agent needs to inspect full statutory provisions before deciding on a legal strategy.
- Step 1 (
dike_search): Send a natural language query withtop_k: 5to identify candidate statutes and court judgements. - Step 2 (Filter & Select): The agent inspects the 800-character snippets and selects the most relevant
canonical_id. - Step 3 (
GET /v1/document/{id}): Hydrate the complete document text or article list to examine full legal definitions and exclusions.
Pattern 2: Currency & Legislative History Auditing
Never rely on an indexed statute without verifying whether subsequent legislation has amended or repealed its articles.
Rendering diagram...
- Call
dike_graph_traversewithdirection: "in"andedge_types: ["amends", "repeals"]. - Inspect the connected
nodes. If an amending statute exists (e.g.eg-leg-2021-45), the agent knows the primary statute has undergone legislative revision.
Pattern 3: Direct Grounded Q&A vs. Custom Synthesis
When should an agent call dike_reason versus performing its own synthesis from dike_search?
| Consideration | Use dike_reason | Use dike_search + Custom LLM |
|---|---|---|
| Citation Integrity | Guaranteed: Real-time token guard strips any hallucinated reference. | Vulnerable to LLM citation fabrication. |
| Output Style | Authoritative Arabic legal summary with [1] footnotes. | Flexible formatting, custom persona, or multi-modal UI. |
| Multi-Source Combining | Limited to Dike's indexed corpus. | Can combine Dike search results with private customer PDFs or CRM data. |
| Throughput Cost | 10 req/min limit on Pay As You Go (uses reasoning compute). | 120 req/min limit on Pay As You Go (lightweight retrieval). |
Pattern 4: Rate-Limit & Token-Budget Optimization
In multi-agent swarms or complex tree-of-thought workflows, calling dike_reason at every intermediate sub-step will quickly exhaust rate limit quotas.
Best Practice
- Use
dike_searchanddike_graph_traversefor exploratory branch evaluation, document filtering, and consistency checks. - Reserve one single
dike_reasoninvocation for the final user-facing response synthesis.
Next Steps
- See these patterns applied in production in Case Studies.
- Review the Grounded Q&A Walkthrough for frontend UI patterns.
- Explore the high-performance gRPC Mirror.