Metadata-Version: 2.4
Name: lfx-loopgrid
Version: 0.1.0
Summary: LoopGrid evidence components for Langflow/LFX
Project-URL: Homepage, https://loopgrid.io/integrations/
Project-URL: Repository, https://github.com/loopgridio/loopgrid-langflow
Project-URL: Issues, https://github.com/loopgridio/loopgrid-langflow/issues
Project-URL: Documentation, https://loopgrid.io/integrations/
Author-email: LoopGrid <hello@loopgrid.io>
License: Apache-2.0
License-File: LICENSE
Keywords: ai-agents,evidence,governance,langflow,lfx,loopgrid
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: <3.15,>=3.10
Requires-Dist: lfx<2.0.0,>=1.12.3
Description-Content-Type: text/markdown

# lfx-loopgrid

LoopGrid extension for **Langflow 1.12 / LFX**. It adds a `LoopGrid` bundle with six components for recording and verifying signed, tamper-evident evidence around consequential AI-agent decisions.

> Design-partner release. LoopGrid records evidence; it does **not** execute the external business action.

## Components

Inside the **Loopgrid** bundle in the Langflow palette:

- Record Decision
- Record Action
- Record Outcome
- Submit Review
- Get Decision
- Verify Decision

The shorter palette labels are intentional so the operations remain distinguishable in Langflow's narrow component sidebar. Internal component class names remain stable (`LoopGridRecordDecision`, `LoopGridRecordAction`, and so on).

## Visual chaining

Components that operate on an existing decision expose two alternatives:

- **Decision Data** — connect a `Data` output from another LoopGrid component. The decision ID is extracted automatically.
- **Decision ID** — enter an existing LoopGrid decision ID manually when the component is not connected upstream.

A typical connected flow is:

```text
Record Decision
    -> Record Action
    -> Record Outcome
        -> Get Decision
        -> Verify Decision
```

For human review, connect a pending-review decision (for example from **Get Decision**) to **Submit Review**, or enter the pending decision ID manually.

## Requirements

- Python 3.10-3.14
- Langflow 1.12.x / LFX Bundle API v1
- A reachable LoopGrid deployment
- LoopGrid workspace ID and API key

## Local development (Windows PowerShell)

```powershell
uv venv --python 3.12 .venv
.\.venv\Scripts\Activate.ps1
uv pip install "langflow~=1.12.3" build twine pytest

lfx extension validate .
python -m unittest discover -s tests -v
python -m compileall -q src tests
python -m build
python -m twine check dist/*
```

`lfx extension validate . --execute-imports` is an optional deeper import probe. Langflow/LFX 1.12.3 can report a subprocess circular-import false positive even when normal imports and runtime loading succeed, so release validation should include the actual Langflow UI smoke test.

To register the extension for local development:

```powershell
lfx extension dev .
```

If the project path contains spaces on Windows and the dev command's automatic launcher mis-parses the path, registration still succeeds; launch Langflow separately:

```powershell
langflow run
```

The `Loopgrid` bundle should appear in the component palette with all six components.

## Install after PyPI release

```powershell
uv pip install lfx-loopgrid==0.1.0
langflow run
```

Extension discovery occurs when Langflow starts, so restart Langflow after installation or upgrade.

## Credentials

Each component accepts:

- **LoopGrid Base URL** — for example `http://127.0.0.1:8000` locally or an HTTPS deployment
- **LoopGrid API Key** — secret field, sent only in `X-LoopGrid-Key`
- **Workspace ID** — defaults to `default`

For a lifecycle using all six components, the key needs the corresponding LoopGrid `ingest`, `read`, and `review` permissions. Prefer narrower keys for narrower flows.

## Privacy

**Record Decision** defaults to `redacted`. Only map data intentionally selected for evidence capture. The extension does not automatically read complete chats, files, environment variables, or unrelated flow state.

## Verification

**Verify Decision** performs verification through the connected LoopGrid service. Independent/offline evidence-bundle verification remains available through `loopgrid-verify`.

## Source and support

- Source: https://github.com/loopgridio/loopgrid-langflow
- Website: https://loopgrid.io
- Contact: hello@loopgrid.io

## License

Apache-2.0.
