While many teams are handing AI agents direct access to their databases, Ibrahim Arief (Ibam) is arguing for the opposite. In a long post on X on 2 November 2026, the builder of PerkaraAI revealed one of the product's "kitchen secrets": its AI does not write its own queries against raw data. Instead it asks questions through a semantic model — a multi-layered knowledge graph with an ontology designed specifically for legal case investigation. By his account, a single case can hold around one million entities and relationships, and this approach is what made the AI's answers start to feel genuinely useful.
One caveat up front: everything below is a product builder describing his own product. No independent evaluation of PerkaraAI's accuracy has been published.
Key Takeaways
- The problem: an AI agent given raw database access and left to compose SQL on its own is, according to Ibam, error-prone — even with 2026 frontier models — because one question can be read as thousands of different queries.
- The fix (PerkaraAI's claim): reorganise all case knowledge into a semantic model, so agents query through meaningful relations such as "attended" or "works at" rather than text matching.
- Scale: roughly 1 million entities and relationships per case, by his estimate.
- Implementation: event-driven ETL pipelines, and in some cases simply PostgreSQL materialized views.
- General lesson: beyond the architecture, the ontology has to fit the domain — an import-export business, a hospital and a courtroom each need a different one.
Timeline
| Date | Event |
|---|---|
| 25 Oct 2026 | Ibam and Ririe introduce PerkaraAI, an AI born out of a legal case they were going through themselves |
| 31 Oct 2026 | Ibam announces a "kitchen secrets" series on making AI more accurate across documents thousands of pages long |
| 2 Nov 2026 | First technical post: semantic models and knowledge graphs as the bridge between AI and case data |
From Courtroom to Startup
PerkaraAI has an unusual origin. In the launch post, Ibam and Ririe — who signed it as Founding Engineer and Founding Legal — describe more than a year of legal proceedings that they characterise as criminalisation. In their telling, the AI Ibam built helped the defence team work through thousands of pages of case files, connect the threads across hundreds of witnesses, compare well over ten thousand written statements and make sense of hundreds of hours of oral testimony, surfacing dozens of findings and contradictions.
They say the sentence was far lighter than what the prosecution sought and that two of the five judges held Ibam should have been acquitted. Even so, his side has filed an appeal and a cassation, so the case is not over. All of this comes from Ibam and his family's side of the story.
PerkaraAI grew out of that experience. According to the post, it already has its first paying customer, has funding commitments from several angel investors, is at the pre-seed stage and is led by Ainun Najib as founder. They also promise free access for pro bono cases handled by legal aid organisations (LBH), with limited capacity for now, and plan to release some features as an open-source Community Edition aimed at investigators and judges.
Why Raw Text-to-SQL Breaks Down
Ibam opens with a company that was building an AI assistant for office operations. When he tried it, the answers wandered and missed the point. The reason: the agent had database access and was expected to decide on its own which SQL to write, then run it.
His example is easy to follow. To list employees who met with "Official Z", an agent might write a query that looks for documents containing an employee's name, "Official Z" and the word "meeting". That looks reasonable, yet a line like "Please tell Mr Z that Budi can't make the meeting" would be counted as a meeting. Text matching has no grasp of what "can't make it" means.
Semantic Models: Querying by Meaning
The alternative, in Ibam's description, is to rebuild the case knowledge as a graph: people typed as employees, companies, events typed as meetings, dates and officials, linked by relations such as "works at" and "attended". The agent then issues a high-level graph query — roughly "which employees of company X attended a meeting on date Y with official Z" — and the semantic relations decide which data is relevant.
He says the results feed case analysis, witness cross-examination and RAG for chat answers.
Terms Worth Knowing
- AI hallucination: output that sounds confident but is not supported by the data. Ibam claims general models such as ChatGPT, Claude and Gemini already hallucinate on documents of about 150 pages — a figure he gives without published test data.
- Knowledge graph: knowledge represented as nodes (entities) and edges (relationships).
- Ontology: the vocabulary of entity and relation types that applies within a domain.
- RAG (Retrieval-Augmented Generation): having the model answer from retrieved data rather than from memory alone.
- Materialized view: a stored, refreshable query result in the database, handy as a pre-shaped data layer.
What Developers Can Take From It
Whatever one makes of the product claims, the architectural point applies to anyone building AI on top of company data: know your model's limits, do not leave the interpretation of raw data entirely to an agent, and build a layer of meaning designed for your business domain. Ibam does not prescribe a single kind of semantic model; he suggests researching the options and picking whatever fits the use case.
Still Unclear
- The "kitchen secrets" series continues; the next topic has not been announced.
- No benchmark or measured accuracy figures have been published for PerkaraAI.
- Timing for the Community Edition and the number of pro bono cases it can take on are not set.
- The appeal and cassation in Ibam's case are still pending.