---
title: Offer Loom in an agent platform or factory
lastModified: '2026-12-02T01:42:46.000Z'
description: An agent platform, or a factory that runs agents through fixed stages such as plan, implement and review, can offer Loom as an optional shared memory and code…
---

An agent platform, or a factory that runs agents through fixed stages such as plan,
implement and review, can offer Loom as an optional shared memory and code retrieval
service through MCP, HTTP or the SDKs. Start with a running [Loom
deployment](/docs/operations/deployment), credentials for the intended namespaces, and
an explicit choice of which application stages call it.

## Choose what the integration owns

Keep the framework's execution state and Loom's shared knowledge distinct. A framework
can retain its conversation, checkpoint and orchestration state while Loom holds facts
or documents that other agents and later sessions need. A native adapter can also put
the state its interface supports in Loom; each
[framework adapter](/docs/features/integrations/frameworks) documents that boundary
and its optional dependencies. Installing an adapter does not make every framework
memory operation use Loom.

Choose an interface for the application you deliver:

| Integration              | Application responsibility                                                            | Starting point                                                                                  |
| ------------------------ | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| MCP                      | Configure the endpoint, token, tool listing and model's tool loop                     | [MCP clients](/docs/features/integrations/mcp-clients)                                          |
| Native framework adapter | Install the matching dependency and bind the supported interface                      | [Frameworks and orchestrators](/docs/features/integrations/frameworks)                          |
| Direct SDK or HTTP calls | Await recall, validation or recording at defined stages; handle errors and abstention | [Agent integration](/docs/guides/agent-integration)                                                       |
| Model-selected SDK tools | Supply definitions, execute selected calls and return their results to the model      | [Code tools](/docs/guides/code-tools) and [SDK tool loops](/docs/reference/python-sdk#sessions-and-tools) |

For a factory, place retrieval before planning or implementation when its result is
required. Let investigation tools answer additional questions during the run. Record
the outcome after the task's own checks. The
[invocation paths](/docs/guides/agent-integration#who-invokes-loom) distinguish application calls,
plugin hooks and model choices; no particular factory controller is required.

## Call Loom explicitly from an SDK

The [Claude Agent SDK](/docs/guides/headless-bots) can load Loom as an MCP server or as the plugin,
with its hooks and skills; that page lists each route. To call an operation directly
from application code, use the SDK.

Install the [Python SDK](/docs/reference/python-sdk) and set `LOOM_BASE_URL` to the
deployment and `LOOM_API_KEY` to a token with namespace-wide read access to
`team-context`. Replace the example organization and namespace with scopes that token
permits. A user- or session-scoped integration also passes `user_id=` and `session_id=`
to `call`.

```python
import asyncio
import os

from loom import Agent


async def main() -> None:
    async with Agent(
        org="example",
        namespace="team-context",
        agent="triage-worker",
        base_url=os.environ["LOOM_BASE_URL"],
        api_key=os.environ["LOOM_API_KEY"],
    ) as agent:
        result = await agent.call(
            "memory.search",
            agent="*",
            namespace_scope="this",
            query="Which checks are required before a change?",
            top_k=3,
        )
        print(result)


asyncio.run(main())
```

This application call runs without asking a model to select a tool. Inspect `results` or
`abstain` before adding evidence to the prompt; an abstention is an expected outcome
when no memory qualifies. Authentication or transport errors need their own handling.
`namespace_scope="this"` limits the search to `team-context` regardless of the
deployment default. `agent="*"` searches across writers there without widening the token's
[read scope](/docs/concepts/identities-and-namespaces#read-scope-inside-a-namespace).
The [memory operation reference](/docs/reference/operations/memory#memorysearch) defines
the response. Use `call_with_meta` when recording the request ID and timings
([request correlation](/docs/features/integrations#joining-a-request-across-systems)).

For code investigation, use the Python and TypeScript
[`loom_code_lookup` examples](/docs/guides/code-tools). The application fixes the code namespace;
the model chooses `symbol`, `search`, `callers` or `impact`. The model's ordinary tool
loop must still dispatch the selected call. An application can instead call the
[code operations](/docs/reference/operations/code) directly by their dotted names.

## Diagnose agents that never call the tools

Check a representative task from connection through use of evidence:

1. Confirm that the client can discover the intended tool and that the token can read
   its namespace. A successful connection alone does not test either condition.
2. Make one explicit, relevant call. Check for a usable result, abstention, denied access
   or a provider error before changing the model's instructions.
3. Check whether the running client supplied tool definitions and executed selected
   calls. A raw model request does not run coding-client lifecycle hooks.
4. Give the model a short policy saying when to use each tool and when existing evidence
   is sufficient. Reuse the [coding-agent policy and diagnostics](/docs/features/integrations/claude-code#claude-does-not-call-loom-tools).
5. Record each call's path and outcome as in step 3 of the
   [evaluation](#evaluate-loom-on-your-own-tasks), then
   [evaluate answer quality](/docs/getting-started/evaluate).

If a stage must retrieve or validate something, enforce that dependency in application
code. Instructions guide discretionary tool use; they do not enforce a required gate.

## Evaluate Loom on your own tasks

Run the evaluation on the platform's own repositories and tasks. The
[benchmark coverage map](/docs/benchmarks/coverage) separates published results from
harnesses without published measurements, and links each result to its artifacts,
models, datasets, reproduction commands and limitations. A published retrieval score
does not establish a task-success or cost gain for a different agent platform.

Follow [compare coding agents with and without memory](/docs/getting-started/evaluate#compare-coding-agents-with-and-without-memory)
and [keep the comparison fair](/docs/getting-started/evaluate#keep-the-comparison-fair)
for frozen inputs, fresh sessions, paired arms and uncertainty. For a platform, also:

1. Grade whole tasks with the
   [task sheet](/docs/getting-started/evaluate#grade-whole-tasks-with-a-task-sheet),
   and include triage, design and implementation tasks and tasks that need no shared
   context.
2. Apply the same cutoff to indexed source, Git, pull-request and tracker history, and
   cached answers. If either arm may have seen a reference fix or held-out test, report
   that pair separately as contaminated and rerun both arms with isolated evidence.
3. Record each task's calls by path (application call, hook or model-selected tool) and
   whether the evidence reached the model. Count zero-call tasks as outcomes, and report
   failed or misconfigured requests as integration failures, apart from retrieval misses.
4. Count tool-definition overhead, Loom's provider work, and indexing and operating cost.
   Mark unavailable usage or prices as unknown; an absent cost field is not zero.

Report every task on the task sheet with its integration use from step 3. For
implementation tasks, also report the
[software factory pilot scorecard](/docs/guides/software-factory-tools#software-factory-pilot-scorecard).

Set acceptance thresholds before running the protocol. The protocol is a proposed
evaluation, not a measured result.

## Ship Loom with a platform

A platform provider can integrate a Loom service its user operates or package the
documented [container or Kubernetes deployment](/docs/operations/deployment) with its
application. Agree who operates storage, model providers, backups, upgrades and
credential rotation. Test the same release and adapter dependencies that will ship;
main-branch documentation can describe changes absent from an installed release. Use
the [release history](https://github.com/ClickHouse/loom/releases) and
[supported versions](/docs/operations/supported-versions) to choose the matching source.

Give each service identity only the namespaces and roles it needs
([tokens and grants](/docs/guides/tokens-and-grants)). Repository indexing credentials and Loom
read authorization are separate controls: the Git credential that clones a repository
grants no Loom token read access to its index. Test allowed reads, denied reads, revocation
and [repository-job isolation](/docs/operations/code-index-operations#repository-job-sandbox)
before delivery. Set retention and
[erasure](/docs/features/memory/retention-and-erasure) requirements for shared content.

Make optional integration behavior explicit in the platform: whether a user has
enabled it, which stages depend on it, and what users see when it is unavailable. Treat
required validation failures as failures; report omitted optional context rather than
silently claiming it was used.
