AI Book Assistant Case Study: Recommending Legal Books From a Reader's Case
How the AI assistant on the Dar El Ahram legal bookshop reads the catalogue and the books' table-of-contents PDFs, answers a legal question with the books that fit and why, and stays fast, safe and within a monthly cost.

The AI assistant on the Dar El Ahram online bookshop takes a reader's legal situation, written in his own words, and answers with the books from the catalogue that fit it and why each one fits. It can do this because it reads the catalogue, including the table-of-contents PDFs of the books, so it can draw on what a book covers, not only on its title.
That matters because a legal reader rarely knows the exact title he needs. Before the store, he had to call a branch and describe his case. This case study explains how we built the assistant for Dar El Ahram, what it answers, how it stays fast and safe, and what any store owner can learn from it. The full store story is in the Dar El Ahram online bookshop case study.
Key takeaways
- The assistant starts from the reader's case, not from a title, and answers with the fitting books and the reason for each.
- It reads the catalogue together with the books' table-of-contents PDFs, which are indexed in the background with progress tracked per book.
- It also answers practical questions: price, whether a book is in stock, ordering and shipping.
- Answers stream live, readers can rate an answer, and each visitor's chat history is kept.
- Abusive messages are filtered before any AI call, requests are rate-limited per minute and a monthly usage cap keeps costs predictable.
The problem: readers know their case, not the title
Dar El Ahram publishes more than 800 legal titles across 19 legal branches, by more than 340 authors. Filters by branch and author help a reader who already knows his field. But a lawyer preparing a case usually thinks in facts and questions: a dispute over a lease, a dismissal from work, a procedural deadline he is unsure about. A book title like "Commentary on the Civil Code" does not tell him whether chapter seven covers his exact point.
Before the store, the answer to that question lived in the heads of the sales team. The assistant's job is to give every reader that same guidance on the website, at any hour, without a phone call.
What the assistant answers
We kept the assistant focused on the questions readers actually bring to a bookshop:
- "Which book do I need for this?" The reader describes his legal situation and gets the books that fit, with a short explanation of why each one is relevant.
- "How much is it, and is it available?" The assistant gives the price and whether the book is in stock.
- "How do I order, and do you ship to me?" It answers questions about ordering and shipping.
It answers around the clock, so a lawyer working late on a memo does not have to wait for a branch to open.
| Reader's question | What the assistant draws on | What the reader gets |
|---|---|---|
| A description of a legal situation | The catalogue and the books' table-of-contents PDFs | Fitting books and why each one fits |
| Price and availability of a book | The store's catalogue | The price and whether it is in stock |
| Ordering and shipping | How the store takes and ships orders | A direct answer instead of a phone call |
How it knows what is inside a book
A recommendation is only as good as what the assistant knows about the books. Titles and short descriptions are not enough for legal books, where one volume can cover dozens of topics. So the assistant reads the catalogue together with the table-of-contents PDFs attached to the books.
Reading those PDFs is done as a background job, not while a reader is waiting. The indexing status and its live progress are tracked for each book, so it is clear which books the assistant can already draw on, and new titles can be indexed the same way.
The result is the difference between keyword search and real guidance. A search for a word only finds books with that word in the title or description. The assistant can match a reader's situation to a chapter heading deep in a table of contents and point him to that book.
An illustrative example of the flow
The following is an illustrative example of how a conversation runs, not a transcript. A reader writes that his landlord is refusing to renew an old rental contract and he wants to understand his position before seeing his lawyer. The assistant looks for books whose contents cover lease and rental disputes, answers with a short list, and for each one explains which part of the book relates to his situation. If he then asks the price of one of them or whether it ships to Alexandria, the assistant answers that too, and he can go to the book's page to order.
Fast answers and feedback
Two details make the assistant feel responsive:
- Streaming. The answer appears word by word as it is written, instead of after a long pause. For a detailed recommendation this makes a real difference to how long the wait feels.
- Chat history. The visitor's conversation is kept, so he can come back to a recommendation instead of starting again.
Readers can also rate an answer. Ratings like these are a simple record of which answers helped and which did not, and that record is the starting point for improving any assistant.
Keeping it safe and within budget
A public chat box on a busy store receives every kind of message. We put three protections in front of the AI:
- Abuse filtering before any AI call. Each message is checked by a free content moderation step first. Abusive messages are stopped there and never reach the paid model.
- A per-minute rate limit. One visitor cannot flood the assistant with requests.
- A monthly usage cap. The assistant's total usage has a monthly ceiling, which keeps the running cost predictable for the publisher.
We explain these cost controls in detail, for any store, in keeping an AI chatbot's costs predictable. The wider question of keeping an assistant honest about prices and promises is covered in keeping a store chatbot honest.
What store owners can learn from it
- Find where customers get stuck. At Dar El Ahram it was not knowing the title. At a coffee roastery or an appliance shop the sticking point is different, and the assistant should be built around that.
- Feed it what your experts know. The sales team knew what was inside each book. The table-of-contents PDFs gave the assistant the same knowledge.
- Keep it inside your catalogue. A bookshop assistant is there to point readers to books, prices and ordering. Decide its scope before launch and test it against real questions.
- Protect the budget from day one. Filtering, rate limits and a monthly cap are cheaper to build in than to add after a surprise bill.
- Measure with ratings. A rating on each answer tells you where to improve.
For a broader view of what shopping assistants do in Egyptian stores, read our guide to AI shopping assistants.
How it fits into the store
The assistant sits as a chat widget on the store, next to the normal ways of finding a book: legal branch pages, author pages, filters and search. It does not replace them. A reader who knows the author goes to the author page. A reader who knows only his case asks the assistant. Both lead to the same books, the same cart and the same checkout, and the order lands in the same dashboard. Because every book has its own page that Google can find, as described in SEO for a large book catalogue, the assistant and search bring readers to the same places.
It was built in the third phase of the project, after the catalogue, payments, shipping and dashboard were already live, using the OpenAI API with a Node.js backend.
How Nilex helps
We build AI assistants that work on a business's own data, with the protections that keep them affordable. If your customers struggle to find the right product in a large catalogue, these are the next steps:
- Read the project summary on the Dar El Ahram client page.
- See our AI business chatbot service and its packages.
- If you need the store as well, see e-commerce store development.
- Describe your catalogue and the questions your customers ask through the contact page, and we will reply with a proposal.
Frequently asked questions
What does the Dar El Ahram assistant read to make recommendations?
It reads the store's catalogue together with the table-of-contents PDFs of the books, which are indexed in a background job with progress tracked per book.
Can it tell a reader the price and whether a book is available?
Yes. Besides recommending books for a legal situation, it gives the price, says whether the book is in stock and answers questions about ordering and shipping.
What happens if someone sends abusive messages?
Every message goes through a free moderation check before any AI call. Abusive messages are filtered there and never reach the AI model, and a per-minute rate limit stops flooding.
How is the AI cost kept under control?
Filtering before the AI call, a per-minute rate limit and a monthly usage cap. Together they keep the monthly cost predictable.
Can Nilex build a similar assistant for a store that does not sell books?
Yes. The approach is the same: give the assistant your catalogue and the knowledge your team uses to advise customers, keep it focused on your products, and protect it with filtering and limits. Contact us with the details of your store.
How We Built Our Own AI Sales Assistant: A Consultant That Recommends Systems Without Making Things Up11 October 2026 · 8 min
AI Business Chatbots From Nilex: What They Do, What We Connect Them To and the Limits We Set11 October 2026 · 9 min
Keeping an AI Chatbot's Costs Predictable: Usage Caps, Abuse Filtering and Message Limits11 October 2026 · 9 min
