Skip to Content

Core Concepts

Capture knowledge

Write knowledge from your code into a vector or OKF container with Dock, and make it answerable by an engine.

Some knowledge doesn't live in a file or an app you can connect, such as records your service generates or content you assemble at runtime. dock.capture with a container sends that knowledge to Docklee from your code.

Capture knowledge from code when...

  • The content is generated by your own service.
  • You'd rather push updates than have Docklee read a source.

Capture into a container

Declare the container on Dock. A vector container also takes a dimension:

from docklee import Dock

dock = Dock(container="vector", dimension=1024)
dock.capture(
    "Orders over $50 ship free within the continental US.",
    type="knowledge",
    metadata={"policy": "shipping", "version": "2026-10"},
)
result = dock.flush_sync()
print(result.accepted, result.rejected)

The response counts knowledge events under ke_events:

{
  "batch_id": "5a9c1e7f-3d24-4b8a-9e60-c1f7a2d48b3e",
  "accepted": 1,
  "rejected": 0,
  "errors": [],
  "usage": {
    "events_accepted": 1,
    "ke_events": 1,
    "dum_events": 0,
    "processing_time_ms": 521
  }
}

Make it answerable

  1. Find the feed. The first write to a container creates an API/SDK Feed source for it in Sources.
  2. Link it. Open the engine in Knowledge Engines, go to its Sources tab, and add the feed.
  3. Query. The engine now answers from everything written to that feed.

An engine never reads a feed until you link it. Data you write before linking isn't lost. It becomes answerable as soon as the feed is linked.

Types for knowledge

TypeUse it for
knowledgeFacts and reference content for an engine to answer from.
documentLonger written content, such as an article or a page of a manual.

When a Dock declares only a container, every event goes to the container, whatever its type. When it declares a container and a memory space, only knowledge and document events go to the container. See How Docklee works.

Limits

LimitValue
Content per event50,000 characters
Metadata per event10 KB
Events per batch100

Errors

ErrorMeaning
403 with ke_runtime_deniedThe key doesn't include the Knowledge Engines runtime.
422The container isn't vector or okf, or every event was rejected.
ke_ingestion_failed in errorsThe event couldn't be stored. The message says why, such as a dimension that isn't enabled.

Next steps

Your knowledge is in a container. Ask an engine about it next.

On this page