Skip to content

Add the LangChain redaction wrapper integration spike #165

@maziyarpanahi

Description

@maziyarpanahi

Summary

The section 8.3 Week 4 quick-start calls for a first integration spike a LangChain redaction wrapper to prove the 'orchestrator, not dependent' thesis (section 8.8 non-goal #6) and hit the section 8.5 v1.6 ecosystem KPI of 2 first-class integrations (LangChain, DuckDB). This sits in openmed/interop/ and is not a headline of any other section. Decompose before starting.

Scope

  • Prototype an openmed/interop/langchain.py adapter that wraps OpenMed PII de-identification as a LangChain-compatible transform/runnable so text flowing through a chain is redacted on-device before any model call.
  • Demonstrate the orchestrator stance: OpenMed drives redaction; LangChain is an optional consumer behind a guarded import / extra, not a hard dependency.
  • Add an integration test exercising the wrapper end-to-end on a fixture, and a short docs/example.
  • Decompose before starting into: adapter API, optional-extra packaging, RAG-redaction example, and tests.

Acceptance criteria

  • An openmed/interop/ LangChain redaction wrapper exists behind an optional extra (import-guarded; absent LangChain does not break core).
  • An integration test redacts PII in a chain-style flow on a fixture and passes.
  • A docs example shows RAG-style redaction-before-model usage.
  • test suite green: .venv/bin/python -m pytest tests/ -q

Out of scope

  • LlamaIndex, Spark/Ray, DuckDB, or FHIR-server integrations (later milestones).
  • Hosted-service canary.
  • Making LangChain a hard install dependency.

Files

  • openmed/interop/langchain.py
  • pyproject.toml
  • docs/integrations-langchain.md
  • tests/unit/interop/test_langchain_redaction.py

Task: OM-049 · Milestone: v1.7 · Priority: P2 · Size: L
Depends on: OM-035 · Blocks: —
Roadmap: section 8.3 Week 4, section 8.5 v1.6 ecosystem KPI, section 8.8 non-goal #6
Spec: PLANS/V2/EXECUTION/tasks/OM-049.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2MediumfeatureNew capabilityroadmap-v2OpenMed V2 roadmap backlog

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions