Repository navigation
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #703
Changelog category (leave one):
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-loomin Langflow's environment and loadintegrations/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 inintegrations/README.mdand indocs/features/integrations/frameworks.md.The component does not change the Loom server, wire ops, stored data, auth, or tenant isolation. It constructs a
SyncAgentfrom the org, namespace, URL, and API key inputs, then callsmemory.set,memory.search, orknowledge.search. The user input is passed asuser_idon the memory write and search; knowledge search is namespace-scoped. Langflow is not a test or CI dependency: the tests stub thelfxinput and output types and give the SDK anhttpx.MockTransport.The output method is
produce_result, notrun, so the name does not collide with Langflow 1.12.4+ reserved input names.Compatibility, rollout and rollback
clickhouse-loomin Langflow's Python environment and loadintegrations/langflow/loom_component.pyas a custom component. Checked against Langflow 1.13.3.Tests
I ran the issue's component tests and the docs/lint checks this change touches. This environment has no
makeorshfmt, so I ran the equivalent ofmake lintand the non-shell parts ofmake format-checkdirectly..venv/bin/python -m pytest tests/unit/test_langflow_component.py -q: 4 passed in 0.68s. The tests drivesave,search memory, andsearch documents, assert the/v1/memory.set,/v1/memory.search, and/v1/knowledge.searchrequest path and body (org, namespace, user_id, query/value, memory_key, top_k) and the output returned, and rejectsavewithout 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.--checkfor the SDK tables, Codex plugin copies, settings reference/schema/example, docs/reference tables, and the reach census: all current.biome lint frontend/srcandbiome format .: passed (209 and 969 files).I did not run
make typecheckor 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'sSyncAgent,memory.set,memory.search, andknowledge.searchsurfaces.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
makeandshfmtare not installed here, so I did not runmake format-check,make typecheck, ormake test-unit.docs/features/integrations/frameworks.mddescribe the component as it now is.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.