FlexOrch logo
Developers

Agent-ready. MCP server, REST API, and SDKs.

FlexOrch is agent-ready and API-first. Connect AI agents via MCP, build automation with the REST API, or integrate using the Python and TypeScript SDKs — every capability accessible from any environment.

MCP Server — Agent Integration

MCPClaude · Cursor · Windsurf · Any MCP client · 8 tools

FlexOrch is agent-ready. Install the MCP server and your document pipeline becomes a callable tool for Claude, Cursor, Windsurf, or any MCP-compatible agent. 8 tools cover document processing, structured extraction, dataset search, export, and RAG indexing — PII masking and quality scoring included with every call.

pip install flexorch-mcp
{
  "mcpServers": {
    "flexorch": {
      "command": "flexorch-mcp",
      "env": {
        "FLEXORCH_API_KEY": "dfx_your_key_here"
      }
    }
  }
}

Open Source Packages

Python257 tests · zero dependencies

PII detection, quality scoring, and 44-type pattern support across TR, EU, US, and UK. Zero dependencies.

pip install flexorch-audit
from flexorch_audit import audit

result = audit("müşteri_sözleşmesi.pdf")

result.quality_score    # 0.91
result.quality_grade    # "A"
result.noise_ratio      # 0.03
result.pii_findings
# [{"type": "TCKN", "count": 3},
#  {"type": "name", "count": 8},
#  {"type": "email", "count": 2}]
JavaScript / TypeScript222 tests · ESM + CJS

Same API — Node.js and browser. 44 PII types, redact_for_llm(), audit_batch() for TypeScript pipelines. ESM + CJS.

npm install @flexorch/audit
import { audit } from "@flexorch/audit";

const result = await audit("customer_contract.pdf");

result.qualityScore   // 0.91
result.qualityGrade   // "A"
result.noiseRatio     // 0.03
result.piiFindings
// [{ type: "TCKN", count: 3 },
//  { type: "name", count: 8 },
//  { type: "email", count: 2 }]

REST API

# 1. Upload a document
POST /v1/data-process/async
X-API-KEY: dfx_••••••••••••••••••••••••••••••••
Content-Type: multipart/form-data

files: [müşteri_sözleşmesi_q2.pdf]

# ← 202 Accepted
# { "accepted": 1, "jobs": [{ "job_id": 4193, "status": "queued" }] }

# 2. Poll until completed (every 3–5 s)
GET /v1/jobs/4193

# ← { "status": "completed",
#     "execution_summary": { "execution_id": 8821,
#       "privacy": { "pii_findings_count": 14, "masked_record_count": 11 } } }

# 3. Build dataset from execution
POST /v1/datasets/build-from-execution/8821

# 4. Export when ready
GET /v1/datasets/5512/export/json

Quick Start

Complete your first integration in a few steps.

Get an API key

Sign up for free at flexorch.com/signup, verify your email, then create a key from Settings → API Keys. Your key arrives with a dfx_ prefix.

Install the SDK

pip install flexorch-sdk or npm install flexorch-sdk — or use the REST API directly. The platform SDK covers job management, dataset export, and S3 connectors.

Trigger your first job

Upload a document, poll job status, and export the dataset when complete. Async pattern: submit → poll → retrieve.

Read the full documentation →

AI / ML Integration

FlexOrch output plugs directly into LlamaIndex, LangChain, and HuggingFace Trainer — no chunk logic or format conversion needed.

from flexorch_audit import redact_for_llm

# One-line PII redaction before your chatbot processes text
clean = redact_for_llm(document_text, locale="tr")
# → "[MASKED_EMAIL]" and "[MASKED_NATIONAL_ID_TR]" placeholders

# Platform: export pre-chunked, PII-masked datasets via API
# GET /v1/datasets/{id}/export/rag    → LangChain · LlamaIndex
# GET /v1/datasets/{id}/export/hf     → HuggingFace Trainer
# GET /v1/datasets/{id}/export/jsonl  → OpenAI · Mistral fine-tuning

RAG Integrations

The FlexOrch SDK integrates directly with LangChain and LlamaIndex. PII-masked, quality-filtered chunks are ready for hybrid search queries.

LangChain
from flexorch_sdk import FlexOrchClient
from flexorch_sdk.rag import FlexOrchRetriever
from langchain.chains import RetrievalQA
from langchain_openai import ChatOpenAI

client = FlexOrchClient(api_key="dfx_your_key_here")

# Hybrid search — BM25 + semantic vector, grade B+ chunks only
retriever = FlexOrchRetriever(
    client,
    quality_threshold="B",
    mode="hybrid",
    pii_masked=True,
)

qa = RetrievalQA.from_chain_type(
    llm=ChatOpenAI(model="gpt-4o"),
    retriever=retriever,
)
answer = qa.invoke("What are the payment terms in Q1 invoices?")
LlamaIndex
from flexorch_sdk import FlexOrchClient
from flexorch_sdk.rag import FlexOrchReader
from llama_index.core import VectorStoreIndex

client = FlexOrchClient(api_key="dfx_your_key_here")

# Load grade B+ chunks with PII already masked
reader = FlexOrchReader(client, min_quality="B")
docs = reader.load_data(dataset_id=89, pii_masked_only=True)

index = VectorStoreIndex.from_documents(docs)
engine = index.as_query_engine()

response = engine.query("Summarize the contract termination clauses")
print(response)
Read the RAG pipeline documentation →

Resource model

  • documents — uploaded files with metadata and classification state
  • jobs — pipeline configuration and processing status
  • executions — extraction results, quality score, and PII findings
  • datasets — export-ready outputs in 9 formats (JSON, JSONL, CSV, XML, XLSX, PRQ, MD, RAG, HuggingFace)
  • connectors — S3, GCS, and Azure Blob storage integrations with AES-encrypted credentials
  • webhooks — HMAC-SHA256 signed HTTP callbacks on job and dataset events
  • schedules — cron-based automatic ingestion from cloud storage

Developer experience

  • All features accessible via REST API
  • Python and TypeScript SDKs: native type support, zero boilerplate
  • Typed response shapes with predictable error codes
  • Async job pattern: submit, poll status, retrieve output
  • PII and quality signals present in every execution response
  • RAG chunks and HuggingFace Arrow format — LLM ecosystem ready out of the box
  • S3, GCS, and Azure Blob connectors for cloud-native workflows
  • Webhook callbacks with HMAC-SHA256 signing
  • MCP Server — AI agents call FlexOrch tools directly via Claude, Cursor, Windsurf, or any MCP-compatible client
Open the platform

flexorch-audit is open source — standalone PII detection and redaction for Python and JavaScript.

Python ↗JavaScript ↗