Skip to main content

optiondesk-agent

LangChain bindings for the desk. PolyForm Noncommercial 1.0.0, like the rest of the project.

What this is, and what it deliberately is not

It exposes the desk's capabilities as LangChain tools, turns the artifacts on disk into retrievable documents, and assembles a prompt that answers a question strictly from those artifacts.

It is not in the compute path and must never be. Pricing, Greeks, positioning, simulation and backtests all happen in the engine, which has no dependency on this package and no knowledge that it exists. If LangChain were in the compute path, a dependency bump could change a Greek, and the numbers would stop being reproducible from the engine alone.

The separation is the point:

engine    numbers, no dependencies, no network
shell     data, contracts, artifacts, MCP, dashboard
agent     language: tools, retrieval, and prompt assembly

Why it exists next to MCP

MCP serves an agent runtime that already exists, such as Claude Code, Codex or Gemini CLI. This serves an application someone builds themselves, where the desk is one capability among several and the orchestration is theirs. Both call the same commands and read the same artifacts.

Use

from optiondesk_agent import desk_tools, ArtifactStore, build_answer_prompt

tools = desk_tools()                      # LangChain StructuredTools
store = ArtifactStore()                   # documents from the artifact dir
context = store.context_for("SPY")
prompt = build_answer_prompt()            # carries the reporting rules

Bring your own model. This package deliberately declares no provider dependency, so it adds no key requirement and no vendor to the tree.

The graph

A desk routine as a bounded state machine, in graph.py. It needs the optional extra:

pip install -e "agent[graph]"
from optiondesk_agent import open_desk

state = open_desk("SPY", budget=8)
state["outcome"]    # complete, exhausted, or failed
state["summary"]
state["log"]        # every step it took, in order

Opening a desk is a dependency chain rather than one call: a chain snapshot, then a Greek ladder from it, then positioning, then structures, then a comparison. Three nodes handle it. plan reads which stages already have an artifact. gather runs exactly one missing stage per visit and returns to the decision, which keeps the loop visible in the trace and stops a failure at the stage that failed rather than somewhere downstream. report assembles the summary.

The three exits are kept distinct on purpose. complete means every stage has an artifact, exhausted means the step budget ran out, failed means a stage raised. Collapsing them into a boolean is how an agent ends up reporting success on an empty directory.

There is no model in the graph. Every node runs a deterministic command, so the same inputs give the same outputs and a failure reproduces. Pass model= only if you want the closing summary written rather than assembled, and the reporting rules below still apply to it.

Failures end the loop rather than being retried, because every failure this pipeline produces is structural: a missing snapshot, an unbuildable structure, a provider that is not answering. Running the same command again produces the same failure while spending budget a different underlying could have used.

langgraph stays optional at import time. import optiondesk_agent works without it, and only touching open_desk or build_desk_graph pulls it in.

For loops outside an application, in Claude Code itself, see LOOPS.md at the repository root.

The reporting rules travel with the prompt

The prompt template carries the same rules the skills state: report the degraded flag before any number, never substitute a default volatility, never present modelled premiums as tradable, and never turn an analysis into a recommendation. A language layer is exactly where those rules get lost, so they are compiled into it rather than left to the caller.

Metadata

Release files for optiondesk-agent 0.3.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optiondesk-agent 0.3.0.post1
File Size Uploaded Provenance Actions
optiondesk_agent-0.3.0.post1.tar.gz 41.0 kB Without provenance Details for optiondesk_agent-0.3.0.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optiondesk-agent 0.3.0.post1
File Interpreter ABI Platform Actions
optiondesk_agent-0.3.0.post1-py3-none-any.whl Python 3 none any Details for optiondesk_agent-0.3.0.post1-py3-none-any.whl

Total release size: 61.9 kB

Release files / optiondesk_agent-0.3.0.post1.tar.gz

Download URL optiondesk_agent-0.3.0.post1.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
16b3e9324f9d0da610b7552c7066b90d8685bfbd8e6cd5449d72d8c78b28cdbf
BLAKE2b-256 checksum
How to use checksums
2413d366ed35be84ac681fa49412704730dda43dc2204580eb52f4b7ca956c10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / optiondesk_agent-0.3.0.post1-py3-none-any.whl

Download URL optiondesk_agent-0.3.0.post1-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5d9249d65fb7d3f6dcd970fec3b8ae852b68b1b90ccee2e0b89a85d229a3602
BLAKE2b-256 checksum
How to use checksums
8f6e80d0ba2f3ebe06eb6da8ebffc7b2bd905c22bcd6439410f657cdc51461a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for optiondesk-agent 0.3.0.post1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page