The post has been translated automatically. Original language: Russian
A problem that no one notices
Most AI assistants work like parrots: they take a question, run it through a language model, and give an answer from what they know. The problem is that they don't know anything about your data. Ask "how many children are in my group?" and get a polite "I don't have access to your data."
We solved it in a different way. Our AI consultant for the sabidamu monitoring card platform.kz is able to access the database itself through the official function calling mechanism.
We have described 8 tools that AI can trigger.:
1. get_my_groups — list of caregiver groups 2. get_group_children — children in the group 3. search_child — child search by name 4. get_child_report — child development with recommendations 5. get_my_reports — monitoring reports 6. get_my_plans — educational plans7. get_organization_info — information about the organization8. escalate_to_support — send a question to a specialist
The most interesting part begins when one challenge is not enough. The teacher asks, "How is Amir doing?" AI doesn't know who Amir is:
Step 1: Calls search_child(name="Amir")Step 2: Gets id=37662, Balapan group Step 3: Calls get_child_report(child_id=37662)Step 4: Gets grades in 5 categories Step 5: Generates a response with analysis and recommendations
Five steps in one message. A maximum of 5 iterations to avoid going into a loop.
user_id and employee_id are never passed as parameters. They are taken from the server session. The AI cannot request data from someone else's organization.
Instead of 5 minutes of manual search, there is one message: "How has Amir's development changed over the past two monitoring sessions?" The AI will find, compare, and suggest exercises on its own. In 5 seconds.
Most AI assistants work like parrots: they take a question, run it through a language model, and give an answer from what they know. The problem is that they don't know anything about your data. Ask "how many children are in my group?" and get a polite "I don't have access to your data."
We solved it in a different way. Our AI consultant for the sabidamu monitoring card platform.kz knows how to access the database itself. Not through crutches and hacks, but through the official function calling mechanism.
We have described 8 tools that AI can trigger.:
1. get_my_groups — list of caregiver groups 2. get_group_children — children in the group 3. search_child — search for a child by name 4. get_child_report — development of a specific child with recommendations 5. get_my_reports — monitoring reports 6. get_my_plans — educational plans7. get_organization_info — information about the organization8. escalate_to_support — send a question to a specialist
Each tool is described as a JSON schema with parameters. The model decides which one to call and with which arguments.
The most interesting part begins when one challenge is not enough. The teacher asks, "How is Amir doing?" The AI doesn't know who Amir is. That's what's going on.:
Step 1: The AI calls search_child(name="Amir")Step 2: Gets id=37662, Balapan group Step 3: Calls get_child_report(child_id=37662)Step 4: Receives all grades in 5 categories of development Step 5: Generates a human response with analysis and recommendations
Five steps per user message. A maximum of 5 iterations per request, so as not to go into an endless loop.
The key principle is that user_id and employee_id are never passed as tool parameters. They are taken from the server session. An AI cannot request data from someone else's organization, even if it is asked to. The tools work in the current user's sandbox.
When the AI calls several instruments in a row, the response may take 10-15 seconds. The user should not wait with the screen frozen. Therefore, we implemented async mode: the frontend sends a request, receives a task_id, and polls the status every 2 seconds. While the AI is thinking, the user sees an animation of typing.
If the browser closes in the middle of processing, the response will still be saved in the database by task_id. The next time the chat is opened, the user will see it.
External APIs sometimes slow down. The first two attempts have a timeout of 90 seconds. Third attempt with 120 seconds. If it fails, the user receives a polite "Try again later" instead of a technical error.
The caregiver no longer searches for data manually. Instead of: open a group → find a child → open monitoring → select a period → read grades → return → compare with the previous period — one chat message: "How has Amir's development changed over the past two monitoring sessions?"
The AI will find, compare, analyze, and suggest specific exercises on its own. In 5 seconds instead of 5 minutes of manual search.
Imagine: a kindergarten teacher asks an AI consultant, "How do I complete the monitoring?" And he gets the answer: "Contact the administrator of your organization."
Solution: cram the whole context into the prompt
The idea is simple, but the implementation required engineering work. Before each request to the AI, we collect the full context of the user.:
• FULL name (so that the AI addresses "Aigul Maratovna", and not "dear user")
• Position and role in the system
• The name of the organization and its type
• The list of groups that the tutor leads and the number of children in each
• Monitoring status for each group
• Full names of the administrators and methodologists of this organization
All this is packaged in a system prompt. The AI doesn't just "know" the user. He knows his working context.
How it looks in practice
Educator: "Who can give me access to the monitoring of the middle group?"
Previously, the AI would have replied, "Contact your organization's administrator to set up access rights."
Now: "Aigul Maratovna, your administrator Serikov Nurlan Kairatovich can set up access to monitoring of the Balapan medium group. He will be able to add you to the tutors of this group through the "Access rights" section in the monitoring settings."
Do you feel the difference? This is not abstract advice. This is a specific instruction with names and actions.
Technical stuffing
The context is collected in one SQL query with eager loading. The data is cached in the session for 5 minutes, because the composition of the groups does not change every second. The entire context block takes 300-500 tokens in the prompt, but it saves dozens of useless clarifying questions.
We use Grok 3 as the main model. At a temperature of 0.7, the model is loose enough to make the answer sound vivid, but accurate enough not to invent non-existent colleagues.
Unexpected side effect
When the AI addresses by first name and patronymic and knows the real context, the level of user trust has increased many times. People started asking more difficult questions. Not "how to complete the monitoring", but "why does Amir have a low score in the "physical development" category for the third month in a row and what can be done?".
The AI has stopped being a reference. He became a colleague who knows which kindergarten you work in and who you can ask for help.
What's next
We are currently working to enrich the context with the data of a particular child. When the teacher opens Amir's card and asks a question, the AI already knows his age, monitoring results, and developmental dynamics. But this is a topic for the next article.
Проблема, которую никто не замечает
Большинство ИИ-ассистентов работают как попугаи: берут вопрос, прогоняют через языковую модель, выдают ответ из того, что знают. Проблема в том, что они ничего не знают о ваших данных. Спросите «сколько детей в моей группе?» и получите вежливое «я не имею доступа к вашим данным».
Мы решили это по-другому. Наш ИИ-консультант для платформы мониторинговых карт sabidamu.kz умеет сам ходить в базу данных через официальный механизм function calling.
Мы описали 8 инструментов, которые ИИ может вызвать:
1. get_my_groups — список групп воспитателя2. get_group_children — дети в группе3. search_child — поиск ребёнка по имени4. get_child_report — развитие ребёнка с рекомендациями5. get_my_reports — отчёты по мониторингу6. get_my_plans — образовательные планы7. get_organization_info — информация об организации8. escalate_to_support — передать вопрос специалисту
Самое интересное начинается, когда одного вызова мало. Воспитатель спрашивает: «Как дела у Амира?». ИИ не знает, кто такой Амир:
Шаг 1: Вызывает search_child(name="Амир")Шаг 2: Получает id=37662, группа "Балапан"Шаг 3: Вызывает get_child_report(child_id=37662)Шаг 4: Получает оценки по 5 категориямШаг 5: Формирует ответ с анализом и рекомендациями
Пять шагов за одно сообщение. Максимум 5 итераций, чтобы не уйти в цикл.
user_id и employee_id никогда не передаются как параметры. Берутся из серверной сессии. ИИ не может запросить данные чужой организации.
Вместо 5 минут ручного поиска — одно сообщение: «Как изменилось развитие Амира за последние два мониторинга?». ИИ сам найдёт, сравнит и предложит упражнения. За 5 секунд.
Большинство ИИ-ассистентов работают как попугаи: берут вопрос, прогоняют через языковую модель, выдают ответ из того, что знают. Проблема в том, что они ничего не знают о ваших данных. Спросите «сколько детей в моей группе?» и получите вежливое «я не имею доступа к вашим данным».
Мы решили это по-другому. Наш ИИ-консультант для платформы мониторинговых карт sabidamu.kz умеет сам ходить в базу данных. Не через костыли и хаки, а через официальный механизм function calling.
Мы описали 8 инструментов, которые ИИ может вызвать:
1. get_my_groups — список групп воспитателя2. get_group_children — дети в группе3. search_child — поиск ребёнка по имени4. get_child_report — развитие конкретного ребёнка с рекомендациями5. get_my_reports — отчёты по мониторингу6. get_my_plans — образовательные планы7. get_organization_info — информация об организации8. escalate_to_support — передать вопрос специалисту
Каждый инструмент описан как JSON-схема с параметрами. Модель сама решает, какой вызвать и с какими аргументами.
Самое интересное начинается, когда одного вызова мало. Воспитатель спрашивает: «Как дела у Амира?». ИИ не знает, кто такой Амир. Вот что происходит:
Шаг 1: ИИ вызывает search_child(name="Амир")Шаг 2: Получает id=37662, группа "Балапан"Шаг 3: Вызывает get_child_report(child_id=37662)Шаг 4: Получает все оценки по 5 категориям развитияШаг 5: Формирует человеческий ответ с анализом и рекомендациями
Пять шагов за одно сообщение пользователя. Максимум 5 итераций за запрос, чтобы не уйти в бесконечный цикл.
Ключевой принцип: user_id и employee_id никогда не передаются как параметры инструментов. Они берутся из серверной сессии. ИИ не может запросить данные чужой организации, даже если его попросить. Инструменты работают в песочнице текущего пользователя.
Когда ИИ вызывает несколько инструментов подряд, ответ может занять 10-15 секунд. Пользователь не должен ждать с замершим экраном. Поэтому мы реализовали async-режим: фронтенд отправляет запрос, получает task_id, и поллит статус каждые 2 секунды. Пока ИИ думает, пользователь видит анимацию набора текста.
Если браузер закроется посреди обработки, ответ всё равно сохранится в БД по task_id. При следующем открытии чата пользователь увидит его.
Внешние API иногда тормозят. Первые две попытки идут с таймаутом 90 секунд. Третья попытка с 120 секундами. Если и она не прошла, пользователь получает вежливое «Попробуйте позже» вместо технической ошибки.
Воспитатель больше не ищет данные вручную. Вместо: открыть группу → найти ребёнка → открыть мониторинг → выбрать период → прочитать оценки → вернуться → сравнить с прошлым периодом — одно сообщение в чат: «Как изменилось развитие Амира за последние два мониторинга?»
ИИ сам найдёт, сравнит, проанализирует и предложит конкретные упражнения. За 5 секунд вместо 5 минут ручного поиска.
Представьте: воспитатель детского сада спрашивает у ИИ консультанта «как заполнить мониторинг?». И получает ответ: «Обратитесь к администратору вашей организации».
Решение: впихнуть весь контекст в промпт
Идея простая, но реализация потребовала инженерной работы. Перед каждым запросом к ИИ мы собираем полный контекст пользователя:
• ФИО (чтобы ИИ обращался «Айгуль Маратовна», а не «уважаемый пользователь»)
• Должность и роль в системе
• Название организации и её тип
• Список групп, которые ведёт воспитатель, и количество детей в каждой
• Статус заполнения мониторинга по каждой группе
• ФИО администраторов и методистов этой организации
Всё это упаковывается в системный промпт. ИИ не просто «знает» пользователя. Он знает его рабочий контекст.
Как это выглядит на практике
Воспитатель: «Кто может дать мне доступ к мониторингу средней группы?»
Раньше ИИ ответил бы: «Обратитесь к администратору организации для настройки прав доступа».
Теперь: «Айгуль Маратовна, доступ к мониторингу средней группы "Балапан" может настроить ваш администратор Сериков Нурлан Кайратович. Он сможет добавить вас в состав воспитателей этой группы через раздел "Права доступа" в настройках мониторинга».
Чувствуете разницу? Это не абстрактный совет. Это конкретная инструкция с именами и действиями.
Техническая начинка
Контекст собирается за один SQL запрос с eager loading. Данные кэшируются в сессии на 5 минут, потому что состав групп не меняется каждую секунду. Весь блок контекста занимает 300–500 токенов в промпте, но экономит десятки бесполезных уточняющих вопросов.
Мы используем Grok 3 как основную модель. При температуре 0.7 модель достаточно свободна, чтобы ответ звучал живо, но достаточно точна, чтобы не выдумывать несуществующих коллег.
Неожиданный побочный эффект
Когда ИИ обращается по имени отчеству и знает реальный контекст, уровень доверия пользователей вырос кратно. Люди стали задавать более сложные вопросы. Не «как заполнить мониторинг», а «почему у Амира в категории "физическое развитие" низкий балл третий месяц подряд и что можно сделать?».
ИИ перестал быть справочной. Он стал коллегой, который знает, в каком детском саду ты работаешь и кого можно попросить о помощи.
Что дальше
Сейчас мы работаем над тем, чтобы контекст обогащался данными конкретного ребёнка. Когда воспитатель открывает карточку Амира и задаёт вопрос, ИИ уже знает его возраст, результаты мониторинга, динамику развития. Но это тема для следующей статьи.