Skip to content

A Langflow component saves and searches Loom memory and knowledge documents - #832

Open
ningyixi wants to merge 1 commit into
ClickHouse:mainfrom
ningyixi:feat/703-langflow-component
Open

ningyixi wants to merge 1 commit into
ClickHouse:mainfrom
ningyixi:feat/703-langflow-component

Conversation

@ningyixi

Copy link
Copy Markdown
Contributor

Closes: #703

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A Langflow custom component saves and searches Loom memory and searches knowledge documents through the Python SDK. Install clickhouse-loom in Langflow's environment and load integrations/langflow/loom_component.py.

Why

Langflow flows need a first-class way to persist and retrieve per-user Loom memory and to search knowledge documents, with typed inputs for the namespace, the user, and the query. Loom already has framework adapters and standalone integrations (n8n, Dify, LibreChat), but none for Langflow. A custom component that talks to the Python SDK keeps that work in the flow and leaves data in the caller's Loom deployment.

Scope and risk

Adds integrations/langflow/loom_component.py, a README that shows install from a path and a flow that uses the component, unit tests that load the component by path, and a row in integrations/README.md and in docs/features/integrations/frameworks.md.

The component does not change the Loom server, wire ops, stored data, auth, or tenant isolation. It constructs a SyncAgent from the org, namespace, URL, and API key inputs, then calls memory.set, memory.search, or knowledge.search. The user input is passed as user_id on the memory write and search; knowledge search is namespace-scoped. Langflow is not a test or CI dependency: the tests stub the lfx input and output types and give the SDK an httpx.MockTransport.

The output method is produce_result, not run, so the name does not collide with Langflow 1.12.4+ reserved input names.

Compatibility, rollout and rollback

  • Wire: none. No op or field is added, changed or removed.
  • Operator steps: none on the server. To use the component, install clickhouse-loom in Langflow's Python environment and load integrations/langflow/loom_component.py as a custom component. Checked against Langflow 1.13.3.
  • Rollback: revert the pull request. Nothing is stored in a new shape, and no migration is added.

Tests

I ran the issue's component tests and the docs/lint checks this change touches. This environment has no make or shfmt, so I ran the equivalent of make lint and the non-shell parts of make format-check directly.

  • .venv/bin/python -m pytest tests/unit/test_langflow_component.py -q: 4 passed in 0.68s. The tests drive save, search memory, and search documents, assert the /v1/memory.set, /v1/memory.search, and /v1/knowledge.search request path and body (org, namespace, user_id, query/value, memory_key, top_k) and the output returned, and reject save without a memory key.
  • pytest tests/unit/test_public_copy.py tests/unit/test_doc_links.py -q: 258 passed in 26.20s.
  • ruff format --check .: 5538 files already formatted (ruff==0.16.9).
  • ruff check server extractor sdk/python tests scripts .claude: all checks passed.
  • python scripts/gates/function_length_gate.py: passed (baseline unchanged: 55 functions over 50 statements in 51 files).
  • python scripts/gates/check_no_secrets.py: no secrets found in 7261 files.
  • Codegen --check for the SDK tables, Codex plugin copies, settings reference/schema/example, docs/reference tables, and the reach census: all current.
  • biome lint frontend/src and biome format .: passed (209 and 969 files).
  • Prettier 3.9.9 on the edited Markdown: passed.

I did not run make typecheck or the full unit suite. I did not run a live Langflow 1.13.3 session against a Loom quickstart, so the README describes install, the flow, and the Result shape, and does not invent a transcript from a server that was not running here.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Grok Bot. I checked the result against issue A Langflow component for Loom memory and document search #703 (actions, typed namespace/user/query inputs, path-loaded tests with stubbed Langflow types and httpx.MockTransport, docs table rows) and against the LibreChat integration tests and the Python SDK's SyncAgent, memory.set, memory.search, and knowledge.search surfaces.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • The lint recipe and the non-shell format-check steps above passed in this environment. make and shfmt are not installed here, so I did not run make format-check, make typecheck, or make test-unit.
  • No generated files needed regeneration.
  • No migration is added.
  • No plugin-shipped file changed.
  • The frontend was not changed.
  • Docs under docs/features/integrations/frameworks.md describe the component as it now is.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

…uments

A Langflow custom component calls memory.set, memory.search, and
knowledge.search through a SyncAgent, with typed inputs for namespace,
user, and query. Tests load the component by path, stub Langflow types,
and give the SDK an httpx.MockTransport.

Signed-off-by: ningyixi <146685776+ningyixi@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Langflow component for Loom memory and document search

1 participant