3DiVi News

AI-Ready SDK Documentation: What a Coding Agent Built With Face SDK in 15 Minutes

Written by: Sergey Alabugin, Product Owner of 3DiVi Face SDK
Why AI coding assistants need more than traditional SDK documentation, and what changed when we gave them a structured knowledge package.
More and more developers start an integration not in the documentation, but in Claude Code, Cursor, GitHub Copilot or OpenCode. Instead of asking "How does this API work?", they ask the agent: "Build a Java application that does X with this library."
In that workflow the AI agent becomes the first reader of the documentation. The developer reviews, fixes and validates what it produces. So documentation now has two audiences: people and agents.
We see this in Face SDK integrations every month. Developers ask an agent to implement the integration and come to our support when the generated code does not work. The model was rarely the problem. The documentation was written for humans, and the agent could not reliably rebuild the SDK structure from it.

Where human-first documentation confuses AI agents

Face SDK documentation covers several programming languages, processing pipelines, deployment scenarios, API references, migration guides and runnable samples. For an engineer, that is useful depth. For an agent, it creates three problems.
Fragmented information. To complete one task, the agent has to collect context from dozens of pages.
Implicit relationships. Dependencies between modules and processing stages are often implied, not stated. A human infers them; an agent guesses.
Noise. Deprecated APIs, migration guides and historical pages compete with current ones. The agent may mix components from different SDK versions.
The result is code that does not run, or a long loop of manual corrections that cancels out the time the agent was supposed to save.

What we built: a knowledge package for AI agents

In Face SDK 3.31 we added documentation written specifically for coding agents. It does not replace the developer docs. It gives the agent the same knowledge in a structure it can follow.
The developer points the agent to one entry file, AI_KNOWLEDGE_ROOT.md. From there the agent follows a fixed path, in effect a short "Face SDK 101" course, before it writes any code.
File
What it gives the agent
AI_KNOWLEDGE_ROOT.md
Entry point: the map of the whole knowledge package
AGENT_RULES.md
Rules for how to interpret the documentation
context_schema.yaml
105+ Context fields, with the blocks that produce and consume each one
blocks/*.yaml
20 files, one per processing block
best_practices.yaml
16 ready-made pipelines
languages/*.yaml
Language APIs: C++, Python, Java, C#, Flutter
examples/{lang}/
4+ runnable examples per language
The point is order and context. The agent learns how the SDK is put together before it is asked to build something with it.

The test: a Java server app with no ready-made sample

A customer wanted to evaluate Face SDK inside a Java server application. Face SDK has Java API documentation, but all our runnable Java samples target Android. There was no desktop console sample showing the full biometric pipeline.
Normally one of our engineers would write that sample. This time we gave the job to an agent.
We used the free OpenCode tool with its default model, BigPickle, and two prompts. The first one was onboarding only:
Read the Face SDK documentation for AI agents. Entry point: C:\3divi\3_31_0\face_sdk_ai_agent_docs\AI_KNOWLEDGE_ROOT.md. Do not explore any other content in C:\3divi.
Only after that did we describe the task:
Write a console Java application that takes two images as input; runs quality control and a liveness check on each image; matches the two images 1:1; prints quality, liveness and matching results to the console.
About 15 minutes and a couple of clarifying questions about the runtime environment later, we had a working console application. It is good enough to hand to a developer evaluating the SDK as a starting point.
A sample app is the smallest test. Developer Maxim Sokolovsky went further and directed AI coding agents through a complete service on Face SDK: guests submit a selfie and get their photos from an event gallery. Read how he built Selfie Photo Search.

What the agent got right without being told

The code compiling was not the interesting part. The interesting part is three places where real integrations often go wrong. The agent handled each of them correctly, using only what it learned from the knowledge package.

1. It chose the recommended module configurations

private static final String TEMPLATE_MODIFICATION = "1000";

static ProcessingBlock createBlock(FacerecService service, String unitType, String modification) {
    Context config = service.createContext();
    config.get("unit_type").setString(unitType);
    if (modification != null && !modification.isEmpty()) {
        config.get("modification").setString(modification);
    }
    return service.createProcessingBlock(config);
}

detector  = createBlock(service, "FACE_DETECTOR", "ssyv_light");
fitter    = createBlock(service, "FACE_FITTER", "fda");
liveness  = createBlock(service, "LIVENESS_ESTIMATOR", "2d_ensemble");
extractor = createBlock(service, "FACE_TEMPLATE_EXTRACTOR", TEMPLATE_MODIFICATION);
verifier  = createBlock(service, "VERIFICATION_MODULE", TEMPLATE_MODIFICATION);
For recognition it picked modification 1000, and for passive liveness 2d_ensemble: the most accurate options in their lines and the default choice for server and desktop applications. For detection and landmarks it picked ssyv_light and fda, the general-purpose pair that fits most scenarios. It also used the same modification for the template extractor and the verification module, as the SDK requires.

2. It applied the recommended verification threshold

double score = verData.get("result").get("score").getDouble();
// ...
System.out.printf("Verdict: %s%n", score >= 0.85 ? "MATCH" : "NO MATCH");
The agent set the match threshold to the recommended 0.85 instead of an arbitrary value. A wrong threshold is one of the most common reasons a working demo gives misleading results.

3. It respected the pipeline's constraints

int count = (int) ioData.get("objects").size();
if (count == 0) {
    return ioData;
}

fitter.process(ioData);
qualityControl.process(ioData);
if (count == 1) {
    liveness.process(ioData);
}
If no face is found, the remaining blocks are skipped: there is nothing to process. Passive liveness runs only when the image contains exactly one face, because the Face SDK liveness estimator expects single-face images.
Across the whole app, the agent followed the intended order (detection, quality, liveness, template extraction, verification) and did not invent APIs or combine components from different SDK versions.

What it does not replace

The agent produced a starting point, not a production system. It still asked how to set up the runtime, and a developer still reviews the code, tunes the threshold to the target error rates and tests on real data. The difference is where the developer starts: from a working pipeline that follows the SDK rules, not from a blank file.

If you maintain SDK documentation

The biggest gain did not come from the model or from prompt engineering. It came from making the documentation structured and unambiguous. Once the agent got the right information in the right order, the documentation effectively became part of the prompt. What worked for us:
  • One entry point that describes the whole knowledge hierarchy, so the agent never has to guess where to start.
  • Explicit rules for how to read the documentation.
  • A data schema that names which component produces and which consumes each field.
  • One file per module, in a predictable format.
  • Recommended pipelines written down, not scattered across examples.
  • Current APIs only. Deprecated and historical material stays out of the agent's path.
This does not mean writing documentation for machines instead of people. It means making the same technical knowledge usable by both.

Try it with your agent

The AI documentation package ships with Face SDK starting from version 3.31; see Face SDK documentation for AI agents. Point your agent to AI_KNOWLEDGE_ROOT.md, ask it to read the package first, then describe your task.
To evaluate Face SDK in your own stack, request a trial licence. If the agent gets stuck, our support team will help.
2026-11-09 18:38 Articles Face SDK/API