Skip to main content
parsimony-agents

Extensible agent for data discovery, analysis, and visualization

PyPI License: Apache-2.0 Python

parsimony-agents: an Agent bound to FRED answers "How has US unemployment changed since 2020?" by fetching the UNRATE series, running code, and publishing a Dataset and a Chart artifact, ending in result.ok = True.


Parsimony Agents finds data through Parsimony connectors, analyzes it by writing and executing Python, and returns the work as reusable artifacts. The producing notebooks and source lineage are persisted with each dataset, chart, and report so the result can be inspected, reused, or refreshed.

Quickstart

pip install parsimony-agents parsimony-fred
export ANTHROPIC_API_KEY="..."
export FRED_API_KEY="..."
import asyncio
import os

from parsimony_fred import CONNECTORS as FRED
from parsimony_agents import Agent


async def main() -> None:
    agent = Agent(
        model="anthropic/claude-sonnet-5",
        connectors=FRED.bind(api_key=os.environ["FRED_API_KEY"]),
    )
    result = await agent.ask("Show me how US unemployment has changed since 2020")

    print(result.text)
    print(list(result.datasets.keys()))  # published dataset logical IDs
    print(list(result.charts.keys()))    # published chart logical IDs
    assert result.ok


asyncio.run(main())

Agent.ask() returns an AgentResult containing the datasets, charts and reports, the event log, and the context required for a follow-up turn.

Follow-up turns

Pass the previous result's context back in to continue the conversation — the agent keeps the full transcript, so it can resolve references like "that chart" or "the same period":

follow_up = await agent.ask("Now do the same for the Eurozone.", ctx=result.context)
print(follow_up.text)

See Multi-turn conversations for streaming, suspension, and resume.

How it works

The agent works in the same sequence as an analyst:

  1. It searches and fetches data through a consistent connector interface.
  2. It writes Python in a stateful execution environment and observes the result.
  3. It publishes useful outputs rather than leaving them inside the conversation.

Published artifacts use open formats:

  • datasets are Parquet;
  • charts are Vega-Lite;
  • reports are Quarto Markdown;
  • notebooks are plain Python.

Each artifact has a stable identity, a content-addressed snapshot, and links to the code and data that produced it. Refresh walks that lineage and appends a snapshot only when the resulting bytes change.

For different integration levels:

  • Agent.ask() collects a run into one structured result;
  • Agent.run() streams typed events for applications and custom interfaces;
  • Agent.resume() continues a run that paused to ask the user a question.

Adding data sources

Connector packages expose immutable CONNECTORS collections. Bind credentials, compose the sources you need, and pass the collection to the agent:

from parsimony_fred import CONNECTORS as FRED
from parsimony_sdmx import CONNECTORS as SDMX
from parsimony_agents import Agent

connectors = FRED.bind(api_key="...") + SDMX
agent = Agent(model="anthropic/claude-sonnet-5", connectors=connectors)

See parsimony-connectors for available financial and economic data sources, or use parsimony to define connectors for internal data.

Code execution

A standalone Agent runs Python in-process by default. This is convenient for local scripts, but it is not a security boundary.

Hosts can pass create_executor(cwd=...) as code_executor= to select bubblewrap isolation on supported Linux systems. The factory falls back to in-process execution with a warning when that boundary is unavailable. Check executor.capability_tier before running untrusted code.

See Code execution and the Security policy.

Documentation

The complete documentation is published at docs.parsimony.dev.

Development

uv sync --all-extras
uv run pytest
uv run ruff check .
uv run mypy parsimony_agents/

See CONTRIBUTING.md.

License

Apache-2.0. See LICENSE.

Metadata

Release files for parsimony-agents 0.0.2

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

Source distribution (sdist)

Source distribution for parsimony-agents 0.0.2
File Size Uploaded Provenance
parsimony_agents-0.0.2.tar.gz 2.7 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for parsimony-agents 0.0.2
File Interpreter ABI Platform
parsimony_agents-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.9 MB

Release files / parsimony_agents-0.0.2.tar.gz

Download URL parsimony_agents-0.0.2.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9772f35150bf931cd55b5cd2f7bcf7a852f791a31bad7e6ef88dea443bd12a27
BLAKE2b-256 checksum
How to use checksums
8ac6bc9efe86a1f5e5e66ab1ac78028423378a0e1d9ebfdbd056599ba6957102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Aug 10, 2026.

Transparency log

Release files / parsimony_agents-0.0.2-py3-none-any.whl

Download URL parsimony_agents-0.0.2-py3-none-any.whl
Size 255.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d813b231ecfe864c3998351a4eb6b69df43c6d8954319b10f6806140ed182d1
BLAKE2b-256 checksum
How to use checksums
b12b8c467dad8cbb4e44c9e89cb63814e0a9e5baacf192046220beb151ebf768
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Aug 10, 2026.

Transparency log

Security for parsimony-agents 0.0.2

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.

Select from 2 files

Attestation for parsimony_agents-0.0.2.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 Aug 10, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files Full provenance

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