This release is a pre-release and may not be stable for production use.
langchain-finic
Use Finic Grayson decision models in Python, LangChain, and LangGraph.
Documentation · Quickstart · Examples · API reference · Releases
langchain-finic is an open-source Python integration for the
Finic Grayson API. It brings typed,
probability-based decisions into LangChain Runnables, LangGraph workflows, and
agent tools. Use it to add risk assessment, review routing, or decision support
to an application, and to work with Finic custom scoring models.
Maintained by Suprep Labs, this is an independent alpha package; it is not endorsed by Finic or LangChain. See the compatibility and support policy for the public API, tested environments, and versioning commitments.
What can you build?
- Fraud and risk review: ask Grayson structured questions about transaction or account evidence, then route cases according to your application's policy.
- LangChain and LangGraph applications: compose a classifier with LCEL, use it as a graph node, or expose decisions as an agent tool.
- Agent workflows: use optional middleware to route between host chat models or screen proposed tool calls.
- Custom risk scoring: score records with a Finic score model and manage model creation, calibration, and job status through the client or toolkit.
These are integration patterns, not claims of measured fraud detection accuracy. Evaluate decisions on representative data before relying on them.
Quickstart
Python 3.11 or newer and a Finic API key are required.
pip install langchain-finic==0.1.0a8
export FINIC_API_KEY=your_key
from langchain_finic import DecisionRequest, FinicClassifier, Noul
request = DecisionRequest(
data={"events": ["New device", "Payment to an unfamiliar recipient"]},
questions={"takeover": Noul(instructions="Does the evidence suggest account takeover?")},
)
with FinicClassifier() as classifier:
response = classifier.invoke(request)
print(response.nouls["takeover"].noul)
The example sends fictional evidence to Finic and spends API credits. The result
is a model probability, not a verified fraud determination; your application
decides how to use it. The default model is grayson-1; set FINIC_MODEL to
change it. Applications are responsible for loading environment variables,
including values from .env files. See
configuration and data handling
for client ownership, retries, and tracing.
Capabilities
| Capability | Interface |
|---|---|
| Typed decisions | Noul, Choice, MultiChoice, Score |
| LCEL composition | FinicClassifier as a LangChain Runnable |
| Sync and async execution | invoke, ainvoke, batch, abatch |
| Agent tools | classifier.as_tool() with create_agent or ToolNode |
| Custom scoring | FinicScorer, FinicToolkit, and FinicClient |
| Optional middleware | ModelRouterMiddleware and AutoModeMiddleware |
| Host-enabled observability | LangSmith traces and usage metadata |
Batching makes individual API requests. Streaming yields one complete decision. Use a host chat model for chat generation; tool screening remains probabilistic and does not replace application authorization.
How it fits
flowchart LR
A["LangChain / LangGraph"] --> B["FinicClassifier"]
B --> C["Finic Grayson API"]
C --> D["Typed decisions"]
D --> E["Application routing or review"]
LangChain and LangGraph examples
- LCEL and LangGraph: compose a classifier and a typed graph node.
- Finic decisions with LangChain: use a decision in an LCEL chain.
- LangGraph fraud review: route a fictional case through a graph.
- Agent middleware: route between host chat models and screen tool calls.
- Custom scoring: use a scorer as a Runnable or tool, and manage score model lifecycle operations.
- System 1 evaluation: reproduce a small synthetic evaluation of routing and tool screening, including its limitations.
- Usage guide: async calls, batching, agent tools, and configuration.
For middleware, install the extra and the provider packages for your host chat models:
pip install 'langchain-finic[middleware]==0.1.0a8'
Frequently asked questions
How do I use Finic Grayson with LangChain or LangGraph?
Install langchain-finic, set FINIC_API_KEY, and invoke FinicClassifier
with a typed DecisionRequest. The classifier is a LangChain Runnable, so it
can also be composed with LCEL, used in a LangGraph node, or exposed as an agent
tool. See the composition example.
Is Finic Grayson a chat model in this package?
No. The package exposes Finic's structured decision and scoring APIs, not a LangChain chat model. Use a separate chat model when your application needs generated text or an agent that reasons and calls tools.
Does batching send a single request to Finic?
No. LangChain batch methods issue individual Finic API requests. Account for request limits, latency, and API credits when choosing concurrency.
Can I use this package for fraud detection or AML review?
It can integrate Grayson decisions and custom scores into fraud or AML review workflows. The package does not provide a validated fraud or AML detection system, and probabilistic output is not a substitute for authorization or human review where required.
Contributing
See CONTRIBUTING.md for setup, tests, and documentation standards. Default tests run offline with mock providers. Report bugs through GitHub issues and vulnerabilities through private security reporting.
Released under the MIT license. See the changelog for version history.
Metadata
Release files for langchain-finic 0.1.0a8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_finic-0.1.0a8.tar.gz | 307.6 kB | With provenance | Details for langchain_finic-0.1.0a8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_finic-0.1.0a8-py3-none-any.whl | Python 3 | none | any | Details for langchain_finic-0.1.0a8-py3-none-any.whl |
Total release size: 337.9 kB
Release files / langchain_finic-0.1.0a8.tar.gz
| Download URL | langchain_finic-0.1.0a8.tar.gz |
|---|---|
| Size | 307.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82005e68f2fb0181e473021ced410e6d57ce41f76ddd796629c3263be960bf7a
|
|
BLAKE2b-256 checksum How to use checksums |
1602e43781c4992617ad98c4ad4c3a80ffdc8f964f53a251f5285b5c2a9bf52c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logRelease files / langchain_finic-0.1.0a8-py3-none-any.whl
| Download URL | langchain_finic-0.1.0a8-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5320beb781af7caaf5f4ce306811fc24686bd461664179aa5bba730898f0b15a
|
|
BLAKE2b-256 checksum How to use checksums |
804d6da14a21df1cb51adccb183d3d4a69fd2b2beba67c0bfc74a9df8303ca2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logSecurity for langchain-finic 0.1.0a8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for langchain_finic-0.1.0a8.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.