CKN AI

A complete AI toolkit inside your own app

CKN AI puts LLMs (Claude, ChatGPT, Gemini), agents, RAG, machine learning, optimization, OCR and speech-to-text in one library, for Node and the browser. Your business gets AI wired to its own data and systems, without stitching together many SDKs, and can switch LLM vendors without a rewrite.

3LLM vendors behind one API: Claude, ChatGPT, Gemini
19built-in neural network architectures in the catalog
79,943random optimization models where our solver matched the reference exactly
37automated test files covering LLM, agents, ML, solver and vision
Capabilities

What CKN AI does

01

Many LLM vendors, one API

Write once and switch between Claude, ChatGPT and Gemini by changing the provider. Streaming, reasoning, images, audio and file inputs are supported.

  • Cost estimates from a price table you supply
  • Automatic retry on HTTP 429 and 5xx
  • An unsupported input type raises an error instead of being dropped silently
  • Structured JSON answers from the LLM
02

Agents and MCP

Build agents that call your own tools, validate every input against a JSON schema before running, and stop for approval where needed. Connect external MCP servers over stdio or HTTP.

  • Tools declare their side effects (read-only or write)
  • Memory, checkpoints and resuming an interrupted run
  • Step limits and deadlines for every agent run
  • Live progress to the UI over SSE
03

RAG and text processing

Let the AI answer from your own documents. Chunk text, embed it and search by vector, keyword or both together, with Thai-aware tokenizing.

  • Hybrid search (vector + BM25) and HNSW for large corpora
  • Streaming summaries of long documents
  • A web search tool for agents
  • Export and import an index as a binary file
04

Machine learning and forecasting

Train models on your own data with TensorFlow.js, on the server or in the browser: sales forecasts, anomaly detection, customer segments, recommendations.

  • MLP, CNN, LSTM/GRU, autoencoder, Transformer, recommenders and more
  • Preprocessing is saved together with the model
  • k-fold, grid search, and cancellable training in a worker
  • ONNX model inference
05

Optimization and scenarios

Solve planning problems (LP/MILP) such as allocation, product mix and routing with a solver built into the library. Ask what-if questions, and get proposals a person approves before anything is applied.

  • Shadow prices show which constraint limits you most
  • Multi-objective optimization
  • Draft a scenario from plain-language text
  • Never throws: returns a status, and nothing acts on an unusable result
06

Documents, speech and vision

Read invoices, purchase orders and scans into structured data, transcribe audio to text, and detect people and Thai licence plates from camera frames.

  • OCR with Tesseract or an LLM; PDF text layer first, OCR as fallback
  • Speech-to-text via cloud or on-device engines, with SRT/VTT output
  • People detection, tracking and zone counting with your own ONNX model
  • Thai plate parsing with province matching and per-vehicle voting
Performance

Measured, not promised

Every figure comes from a measurement recorded in the package's own documentation, taken on an Apple-silicon Mac with Node 24. Results on other machines will differ.

Exact RAG search (10,000 chunks, 384 dims)
4.8 ms / query
At 100,000 chunks it takes 43 ms per query
HNSW RAG search (10,000 chunks)
0.65 to 0.8 ms / query
About 6 to 7x faster than exact search (4.8 ms), with recall@10 of at least 0.95 in tests. The first index build takes 18 to 24 seconds
Person detection on a 1280x720 frame (416 input, WASM on CPU)
34 ms / frame (29 fps)
At 640 input it takes 78 ms (12.9 fps). No GPU needed
Package overhead per frame (resize, decode, NMS)
7.8 to 11.3 ms
Excludes the model's own time. The tracker adds 0.6 to 1.2 ms
LP/MIP solver vs javascript-lp-solver
within ±5%
Speed within ±5% of the widely used reference library, except tiny models that run in under a millisecond (about 1.2x apart)
MLP training on 5,000 rows x 20 features
259 ms / epoch
On the plain CPU backend. An LSTM on 300 sequences takes 719 ms per epoch. Image (CNN) training belongs on a native or WebGL backend, not the CPU one

Figures come from CKN's own test suites and benchmarks. Real results depend on each system's hardware and data volume.

Business value

What your business gets

No lock-in to one vendor

Pick the LLM that fits your price and quality needs, and change it when the market moves, with the rest of your code untouched. The library embeds no prices: you supply your own table to estimate cost per request.

Risk controlled at code level

Agent tools validate input before every run and declare whether they write data, and a scenario the AI proposes is not applied until a person approves it. Vendor endpoints are limited to https hosts on an allowlist.

Your data and models stay yours

Everything runs inside your own application. OCR, speech-to-text, ML and the solver can run locally without sending data out; an LLM is called only where you choose to. Vision uses the model you select.

For developers

An agent that answers from your documents

In use across the CKN stack

  • The AI SQL assistant in CKN Intelligent (via the /llm entry that avoids TensorFlow)
  • Available to all 14 business services for forecasting, OCR and agents
  • The ckn CLI PDF commands (text reading and data extraction)
import { createInMemoryRagStore, createRagTool, createGeminiEmbeddingProvider,
  Agent, createClaudeProvider } from "@ckn-technology/ai";

const embedder = createGeminiEmbeddingProvider({
  apiKey: process.env.GEMINI_API_KEY!, model: process.env.EMBEDDING_MODEL!
});
const store = createInMemoryRagStore(embedder, {
  chunkOptions: { strategy: "paragraph", maxTokens: 512 }
});
await store.index([{ id: "doc-1", text: document1, metadata: { source: "internal-wiki" } }]);

const ragTool = createRagTool(store, { name: "search_knowledge_base", topK: 5,
  description: "Search the internal knowledge base." });
const agent = new Agent({
  provider: createClaudeProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }),
  model: process.env.LLM_MODEL!, tools: [ragTool]
});
const result = await agent.run({ input: "What is our onboarding process?" });
CKN Technology

Explore the other packages

See CKN AI working on your systems

Contact us →