# Query OKF (/docs/okf/query-okf)
There's no separate OKF API to learn. Link OKF sources to an engine, and `lynk.query` and `lynk.retrieve` search them along with any vector sources.

## Link OKF sources [#link-okf-sources]

1. **Find the source.** In **Sources**, open the OKF container. A `Dock` write to `container="okf"` appears as an **API/SDK Feed** source.
2. **Link it.** Open the engine in **Knowledge Engines**, go to its **Sources** tab, and add the source.

OKF sources have no dimension, so you can link them to any engine.

## Ask a question [#ask-a-question]

<CodeTabs>
  <Tab value="Python">
    ```python
    from docklee import Lynk

    lynk = Lynk(engine_id="your-engine-id")
    result = lynk.query_sync("Who owns the report that the orders table feeds into?")
    print(result.answer)
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    import { Lynk, type KnowledgeResult } from 'docklee';

    const lynk = new Lynk({ engineId: 'your-engine-id' });
    const result = (await lynk.query(
      'Who owns the report that the orders table feeds into?',
    )) as KnowledgeResult;
    console.log(result.answer);
    ```
  </Tab>
  <Tab value="cURL">
    ```bash
    curl https://api.docklee.com/v1/engine/query \
      -H "Authorization: Bearer $DOCKLEE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "engine_id": "your-engine-id",
        "query": "Who owns the report that the orders table feeds into?"
      }'
    ```
  </Tab>
</CodeTabs>

The engine follows the links from the orders table to the revenue metric, the report, and its owner, and writes the answer from those concepts.

## Retrieve OKF context [#retrieve-okf-context]

`lynk.retrieve` returns OKF results as chunks, merged with vector chunks in one ranked list:

<CodeTabs items={['Python', 'TypeScript']}>
  <Tab value="Python">
    ```python
    chunks = lynk.retrieve_sync("How does the orders table relate to revenue?", top_k=5)
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    const chunks = await lynk.retrieve('How does the orders table relate to revenue?', { topK: 5 });
    ```
  </Tab>
</CodeTabs>

## Ask questions OKF answers well [#ask-questions-okf-answers-well]

| Instead of | Ask |
| --- | --- |
| `"orders revenue"` | `"How does the orders table feed revenue?"` |
| `"finance report"` | `"Who owns the monthly revenue report?"` |
| `"supplier change"` | `"Which products depend on this supplier?"` |

<Callout type="info">
If OKF retrieval can't run for a question, the engine still answers from its vector sources. OKF adds to an answer and never blocks it.
</Callout>

## Next steps [#next-steps]

You're answering from OKF. Take your bundle with you next.

<Cards>
  <Card title="Export OKF" href="/docs/okf/export-okf" description="Download the bundle as files." />
  <Card title="Query an engine" href="/docs/knowledge/query-an-engine" description="Every query option." />
  <Card title="Retrieve context" href="/docs/knowledge/retrieve-context" description="Every retrieve option." />
</Cards>
