# How knowledge works (/docs/knowledge/how-knowledge-works)
Knowledge Engines answer questions from your own content. You connect sources or write with `Dock`. Docklee processes the content in containers, and an engine searches the sources linked to it when your app calls `Lynk`.

Read this page before you design your engines. It explains why an engine answers only from what you link to it, and how each answer is checked against your sources.

<FlowDiagram
  caption="Content is processed once in a container. Any engine that links to it can then answer from it."
  stages={[
    { title: 'Content', detail: 'Connected sources, and Dock writes that declare a container.' },
    { title: 'Container', detail: 'Chunks, extracts, and embeds, or builds OKF concepts.' },
    { title: 'Engine', detail: 'Searches its linked sources and ranks what it finds.' },
    { title: 'Lynk', detail: 'Returns a cited answer, a stream, or the context itself.' },
  ]}
/>

## Without and with Docklee [#without-and-with-docklee]

| Without Docklee | With Docklee |
| --- | --- |
| You build parsing, chunking, embeddings, and a vector store for each project. | Containers do the processing, and engines share them. |
| Each assistant keeps its own copy of the same documents. | A source connects once and links to any engine. |
| The model can cite things it never saw. | Citations are checked against the chunks the engine used, and invalid ones are removed. |
| Answers drift beyond your content. | The default mode answers only from your sources, and says so when the answer isn't there. |
| Keyword search and semantic search are separate systems. | An engine searches vector and OKF sources together and merges the results. |

## What you send and what's stored [#what-you-send-and-whats-stored]

| You send | Docklee stores |
| --- | --- |
| A 40-page product manual, connected in **Sources** | Chunks with their page numbers and section titles, embedded in a vector container |
| `dock.capture("Refunds are available within 30 days.", type="knowledge")` | A chunk in the container's API/SDK Feed source |
| A wiki connected to an OKF container | Concepts, one per topic, and the links between them |

## On ingest [#on-ingest]

1. **Arrive.** Content comes from a connected source, or from `Dock` with a `container`. See [Capture knowledge](/docs/knowledge/capture-knowledge).
2. **Process.** A vector container splits content into chunks, keeps page numbers and section titles, and embeds each chunk. An OKF container builds concepts and the links between them. See [Containers](/docs/docklee/containers).
3. **Wait for a link.** Processed content belongs to a source. No engine reads it until you link that source to the engine. See [Engines](/docs/docklee/engines).

## On query [#on-query]

1. **Search.** The engine searches every source linked to it, by meaning in vector sources and by concepts and their links in OKF sources.
2. **Rank.** The best results are re-ranked against your question, and the top chunks are kept.
3. **Answer.** For `lynk.query`, a model writes the answer from those chunks only, following the engine's [answer mode](/docs/knowledge/answers/answer-modes). For `lynk.retrieve`, the chunks themselves are returned.
4. **Check.** Each citation is checked against the chunks the engine used. Citations to anything else are removed, and confidence is adjusted to match. See [Citations and confidence](/docs/knowledge/answers/citations-and-confidence).

## Where knowledge lives [#where-knowledge-lives]

| Knowledge | Lives in | Read by |
| --- | --- | --- |
| A connected source | A vector or OKF container, chosen when you add it | Every engine it's linked to |
| A `Dock` knowledge write | The container's API/SDK Feed source | Every engine the feed is linked to |
| A Precision Mode answer | Its container, prepared ahead of time | Every engine that reads the container |

## Build with this flow [#build-with-this-flow]

- Link only the sources an engine should answer from. Every linked source can show up in its answers.
- Keep one vector dimension per engine.
- Use `lynk.query` when Docklee should write the answer, and `lynk.retrieve` when your own model should.
- Show citations in your UI so people can check an answer against the source.
- Treat a low confidence score as a reason to say "I'm not sure", not as an answer.

## Next steps [#next-steps]

You know how knowledge flows. Start by sending your own content.

<Cards>
  <Card title="Capture knowledge" href="/docs/knowledge/capture-knowledge" description="Write knowledge into a container with Dock." />
  <Card title="Query an engine" href="/docs/knowledge/query-an-engine" description="Get a cited answer in one call." />
  <Card title="Retrieve context" href="/docs/knowledge/retrieve-context" description="Get the chunks for your own model." />
</Cards>
