> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onelamp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Library

> An interlinked, tool-maintained Library compiled from your sources.

Library is OneLamp's structured knowledge layer. Where
[context memory](/concepts/context-memory) holds discrete facts, the Library turns
**whole documents** — articles, notes, transcripts, pages from your other tools —
into an interlinked set of pages your tools can navigate and query.

## How it's built

When you ingest a source, OneLamp doesn't just store the raw text. It **compiles**
it: a durable background pipeline reads the source and writes (or updates)
interlinked pages — entities, concepts, sources, and overviews — with `[[Library
links]]` between them. The raw source is kept immutable; the compiled pages are
what you read.

<Steps>
  <Step title="Ingest">
    In the OneLamp web app, add a source (paste text or a URL) from the
    **Library** or **Data Sources** page. OneLamp stores the raw source and kicks
    off a durable compile in the background; the page returns immediately.
  </Step>

  <Step title="Compile">
    The pipeline integrates the source into your existing pages — creating new
    pages, updating related ones, and adding cross-links. This runs in the
    background and is **typically ready within the hour**. On **Pro and
    Enterprise**, the optional **real-time updates** add-on compiles each source
    the moment it arrives.
  </Step>

  <Step title="Read">
    Search the compiled Library or open any page (with its cross-links) from the
    **Library** page in the web app.
  </Step>
</Steps>

<Note>
  Synthesis happens on the **write** path, at ingest. The read path is pure
  retrieval of already-compiled pages — consistent with OneLamp's principle of
  *retrieval, not generation* on queries.
</Note>

## Querying

From the **Library** page, semantic search returns the most relevant page bodies
(with slugs and cross-links) to read over. Two options go further:

* **Synthesize** — return a written answer grounded in those pages, with
  citations.
* **File back** — save that synthesized answer as a new overview page, so an
  exploration compounds into the Library instead of evaporating.

## Keeping the graph healthy

Because the Library is a graph, it can be linted. The Library's **lint** view
reports:

<CardGroup cols={2}>
  <Card title="Orphan pages" icon="link-slash">
    Pages with no inbound links — disconnected from the rest of the graph.
  </Card>

  <Card title="Dangling links" icon="triangle-exclamation">
    `[[links]]` pointing at pages that don't exist yet.
  </Card>

  <Card title="Thin pages" icon="file">
    Pages missing a summary.
  </Card>

  <Card title="Contradictions" icon="not-equal">
    Recently flagged conflicts between sources.
  </Card>
</CardGroup>

Use it to decide what to ingest or clean up next.

## When to use the Library vs. context memory

|              | Context memory                         | Library                                                                |
| ------------ | -------------------------------------- | ---------------------------------------------------------------------- |
| **Unit**     | A discrete fact or preference          | A whole document → interlinked pages                                   |
| **Write**    | `save_context` MCP tool (instant)      | Ingest a source in the web app (compiled in background)                |
| **Read**     | `get_context` MCP tool (ranked chunks) | Search/browse in the Library page (compiled pages, optional synthesis) |
| **Best for** | "Remember that I deploy on Fridays"    | "Ingest this 20-page spec and let me ask about it"                     |

<Note>
  Context memory is the MCP/chat surface your tools call (`save_context` /
  `get_context`). The Library — ingesting, searching, and browsing compiled pages
  — is managed in the OneLamp web app, not through agent tools.
</Note>
