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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsimony_agents-0.0.2.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsimony_agents-0.0.2-py3-none-any.whl (255.0 kB view details)

Uploaded Python 3

File details

Details for the file parsimony_agents-0.0.2.tar.gz.

File metadata

  • Download URL: parsimony_agents-0.0.2.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for parsimony_agents-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9772f35150bf931cd55b5cd2f7bcf7a852f791a31bad7e6ef88dea443bd12a27
MD5 cb084dbe2b5eed2b20e87f1e12feffed
BLAKE2b-256 8ac6bc9efe86a1f5e5e66ab1ac78028423378a0e1d9ebfdbd056599ba6957102

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_agents-0.0.2.tar.gz:

Publisher: publish.yml on ockham-sh/parsimony-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file parsimony_agents-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for parsimony_agents-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d813b231ecfe864c3998351a4eb6b69df43c6d8954319b10f6806140ed182d1
MD5 9be40b4bdc26a7bea8694c7ff9cb7bb4
BLAKE2b-256 b12b8c467dad8cbb4e44c9e89cb63814e0a9e5baacf192046220beb151ebf768

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_agents-0.0.2-py3-none-any.whl:

Publisher: publish.yml on ockham-sh/parsimony-agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

0.0.1

2 files

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