Without UCL
Five separate APIs to query five context sources
With UCL
One UCL call assembles all five in parallel
Unified Context Layer
UCL routes every query to the right context sources, fetches the relevant data, and assembles a single structured bundle ready for your model. No custom retrieval logic. No stitching five APIs together.
Context Bundle
sources5 unified
tokens~1,240
latency< 80ms
Your AI product has five context sources and five different APIs to query them. UCL turns that into one call that returns everything the model needs, nothing it doesn't.
Sources supported
5 built-in
KB, Memory, Session, Tools, Live Data
Assembly mode
Parallel
All sources queried simultaneously
Output format
One bundle
Structured JSON + system prompt ready
The problem
Without UCL
Five separate APIs to query five context sources
With UCL
One UCL call assembles all five in parallel
Without UCL
Each source returns data in a different format
With UCL
UCL normalises everything into one structured bundle
Without UCL
You decide which sources to query per query
With UCL
UCL routes intelligently based on query intent
How it works
Step 01
UCL analyses every incoming query and determines which context sources are relevant. A question about the user's billing history triggers Memory and Session. A technical question triggers the Knowledge Base. Irrelevant sources are skipped entirely.
Step 02
All selected context sources are queried simultaneously. Knowledge retrieval, memory recall, and session extraction run in parallel. Total assembly time is bounded by the slowest relevant source, not the sum of all sources.
Step 03
Results from every source are merged, de-duplicated, and formatted as a single structured bundle: a token-optimised JSON object plus a system prompt string ready to inject into any model provider's API.
01 Query arrives
Incoming query
"Help me configure the SDK for production use"
Capabilities
UCL scores each context source against the incoming query and skips sources unlikely to contribute. No irrelevant context, no wasted tokens.
All selected sources are queried simultaneously. Assembly latency is bounded by the slowest relevant source, not the sum of all five.
Each source's contribution is ranked and trimmed to a token budget you define. The most relevant context always wins the limited space.
Knowledge snippets, memory facts, session events, and tool outputs arrive in different shapes. UCL normalises them into one consistent schema.
Context sources respect user-level access policies. UCL never surfaces knowledge or memory that the requesting user isn't authorised to see.
For latency-sensitive applications, UCL streams context fragments as they arrive from each source rather than waiting for full assembly.
API
Pass a query and a list of sources to ucl.assemble(). Get back a context bundle and a model-ready system prompt. Done.
import { Lynk } from "docklee";const lynk = new Lynk({ engineId: "eng_docs", memorySpaceId: "space_app" });// Assemble context from knowledge and memory for an incoming queryconst query = "Help me configure the SDK for production use";const [knowledge, memories] = await Promise.all([lynk.retrieve(query, { topK: 5 }),lynk.recall(query, { endUser: "user_7x91k", topK: 5 }),]);// Inject directly into your model callconst response = await openai.chat.completions.create({model: "gpt-4o",messages: [{ role: "system", content: buildPrompt(knowledge, memories) },{ role: "user", content: userMessage },],});
Use cases
UCL is the context plumbing that ships once and works everywhere your AI talks to a user.
Every copilot query instantly draws from the product knowledge base, the user's memory, and the current session state. Context is always complete, latency is always bounded.
Support flows that combine the help center, the user's account history, and their open ticket context in every single reply. No more context-switching between tabs.
Recommendation engines that assemble user preferences from memory, recent behaviour from session context, and domain knowledge from the knowledge base in one round trip.
Agents that query UCL at the start of every action loop. The agent always has complete context: what it knows, what the user wants, and what tools have already run.
Unified Context Layer
One integration. Five context sources. Every query answered with complete context from the first call.