Every Book in Pathway has its own AI agent, Jack. It runs in a Linux sandbox with Python, a filesystem, and network access, and it works with your data using your exact permissions. This page explains how it works, from the context it starts with to the loop it runs.

Jack querying Books across a deal, rendered inline in the chat
Using the chat
Open a new chat or any existing one. Three controls sit around the composer: what the agent can reach, which model runs it, and how to find past chats.Connectors
The + button opens the connector menu. Each toggle grants the agent one capability for this chat, and grants are per chat, so the same agent can be wired differently each time. Attach Books and it starts on those deals; add Gmail and it can read your inbox. The Pathway API is on by default, so the agent can already read across everything you can access. Turning a connector on does two things: it hands the agent the tools for that surface and adds the instructions for using it to the agent’s context. Keep the set tight. The agent works best when it carries only what the task needs.
Connectors map directly to the context the agent receives. Each one you enable appends its instructions to the system prompt, which is why a focused set of toggles keeps the agent sharp. See What the model sees.
Chatting about a Book
Open a chat from inside a Book and that Book is attached automatically. The agent starts scoped to the deal in front of you, so you can ask about it right away.

Inline
@ references to pull a Book into the middle of a message are coming soon.Model
The model selector sets which model runs the chat and how hard it thinks. New chats start on GPT-6.1 Terra at medium effort. You can switch model or effort at any point in a chat.
Higher effort gives the model more time to reason before it answers. Use a lighter model for quick questions and a stronger one, or more effort, for multi-step analysis.
Find past chats
Open the New Chat dropdown to search and reopen earlier chats. The search box filters your history by title.
What you can do
Ask about a Book
Total deposits, true revenue, debt-to-income, a single transaction, a counterparty breakdown. The agent computes from the source data, not from a summary.
Build charts and reports
Ask for a revenue trend, a cash flow heatmap, a custom Excel export, or an HTML report. The output renders inline in the chat.
Work with email
Connect Gmail and the agent can search the inbox, read threads, download attachments, and compare them against Book data. Sending requires your approval.
Attach files
Drop in a CSV, PDF, image, or spreadsheet. The agent reads it, parses it, and cross-references it against the Book.
Chats don’t have to be attached to a Book. A standalone chat gets the same sandbox and tools, just without a Book to read from. Use them for general computation or analysis.
How it works
Three pieces make up the engine.1
Scoped access
The agent reads only what the current user can read. Its permissions are the user’s permissions.
2
A sandbox
A Linux workspace where the agent runs code, writes files, and keeps its working memory.
3
A rendering layer
Any file the agent produces can be saved as an artifact and shown back in the chat.
What the model sees
Before any tool runs, the backend assembles the context for the turn. It is built fresh each time, in a fixed order.1
Preamble
The current date and time, and a line identifying the user and org by name and ID. This grounds the agent in who it is acting for. It comes first on Gemini models, and last on GPT models so the rest of the prompt can be cached.
2
Base instructions
The core system prompt: how to use the sandbox, the tool conventions, and the rules for sharing files and computing instead of guessing.
3
Skills index
One line per skill, name and description. The full text is pulled on demand with
read_skill.4
Capability sections
A section is appended for each capability the chat has enabled. Each one teaches the agent how to use that surface.
5
Conversation history
Every prior message, tool call, and tool result, in order, so the agent has the full thread.
The base instructions and skills index are always present. The rows above are added only when that capability is on for the chat. The result is that two chats can hold the same agent but see different context: a Book chat with Gmail connected gets the API and Gmail sections; a standalone chat with neither gets just the base.
The assembled prompt is sent at the start of each turn, followed by the conversation history. The list of reads and the list of facts are generated from the API itself, so the agent’s picture of Pathway matches what the API serves.
The sandbox
Each chat gets a fresh sandbox, created from a cached snapshot in seconds. It runs Amazon Linux with Python 3.13 and fullsudo. pandas, numpy, matplotlib, seaborn, openpyxl, xlsxwriter, scipy, tabulate, duckdb, and plotly are pre-installed. Anything else installs with pip, and system packages install with dnf. The filesystem is rooted at /tmp/, and the network is open.
Three things are placed in the sandbox before the first message:
Everything else, the agent creates: scripts, query results, charts, spreadsheets, and exports all land under
/tmp/. Book data is not dumped to disk up front. The agent reads it live through the API when it needs it, which keeps the workspace small and the data current.
Sandboxes are ephemeral. One lasts 45 minutes, and longer while a reply is running in it. When it times out between messages, a new one is created from the snapshot, your uploads are restored, and the conversation continues. Files the agent made in the old sandbox are not carried over, so anything worth keeping is saved to the chat as an artifact.
The first sandbox on the platform bootstraps the package set and takes a snapshot. The snapshot is cached in Redis with a 29-day TTL and refreshed before it expires, so every later sandbox starts from it.
The filesystem is the memory
The agent does not pass data between steps through a message protocol. It writes files and reads them back. The filesystem is its working memory. It pulls a Book’s analytics from the API and saves the response to a file. It downloads a document and opens it withview. It writes an intermediate result and finds it again later with ls, cat, grep, or a script. State that matters is on disk, not held in the prompt.
This is why cross-domain work needs no special integration. Asked to compare bank deposits against invoices from email, the agent:
1
Pulls the invoices
Searches your Gmail for the thread, then downloads the attachments to the sandbox.
2
Pulls the Book
Fetches analytics from the Pathway API and saves the response to a file.
3
Writes one script
A Python script reads both sets of files and produces the comparison.
Tools
The core tools are built on two primitives: the shell and the filesystem.bash — run any shell command
bash — run any shell command
The primary tool. Runs scripts, installs packages with
pip or dnf, calls endpoints with curl, pipes output. Each call is a new shell that starts in the directory the last one ended in. A command is stopped after two minutes unless the agent asks for longer, up to four, and the row counts up to that limit while it runs. A command stopped at its limit is marked Timed out. For a longer job, the agent starts it in the background and waits for it or keeps working. Background jobs are listed beside the chat’s menu with their latest output; you can stop one there, and the agent is told you stopped it. Output comes back whole up to 2,000 lines or 50 KB; past that the agent gets the end of it and a file holding all of it, so nothing is lost.write — create or overwrite a file
write — create or overwrite a file
Writes content to a path, creating parent directories as needed. The content is written exactly as given, so nothing needs shell escaping.
edit — exact string replacement
edit — exact string replacement
Replaces a known string in an existing file. Used to revise a script or file in place after the agent has read it.
view — read a file
view — read a file
Reads a file. Text comes back with line numbers. Images and PDFs are rendered into the model’s visual context, so the agent can actually see them. For a long PDF it can ask for a range of pages.
save_artifact — publish a file to the chat
save_artifact — publish a file to the chat
Reads a file from the sandbox and uploads it to permanent storage. The file appears in the chat as a card, right where the agent saved it, and you open it from there: images and PDFs in a viewer, HTML in a sandboxed frame, Excel as a live Office Online preview, everything else as a download. The tool also returns a permanent URL for use outside the chat, such as in an email or a Slack message.
save_artifact is for the user: a file card in the chat. view is for the agent: bytes in the context window for visual reasoning.
That second one closes the loop. The agent can write a script, generate a chart or spreadsheet, view the result, fix the script, and run it again before it ever responds.
Skills
A skill is a written set of instructions for a task the agent does often: generating a PDF with Typst, extracting tables from a scanned statement, doing web research. Skills keep the agent reliable on hard tasks without bloating its context. Each skill appears in the system prompt as a single line: a name and a short description. The full instructions stay out of context until the agent decides it needs them, then it loads them withread_skill.
Extending the agent with code
The agent does not need a custom plugin for every system. It has a real computer, so reaching something new is usually just code.- Any API: the agent can
curlan endpoint orpip installa client and call it from Python. Anything with an HTTP interface, including MCP servers, is reachable from the sandbox. - Reusable instructions: drop a Markdown file or a Python snippet into the Book, and the agent reads it like any other file. A documented procedure becomes something the agent can follow; a helper script becomes something it can run.
- New packages and tools:
pip installfor Python,sudo dnf installfor system packages. If a task needs a library that isn’t preinstalled, the agent installs it.
Scoped platform access
Every reply gets its own read-only API token for the current user, in the organization they are working in, written to/tmp/.api_token. It lasts as long as the reply, which can run for up to an hour, and is deleted when the reply ends. It lets the agent call Pathway’s own APIs under the user’s access control: Books, documents, analytics, funders, screening settings, intake email, and organization data. Reading your Gmail uses the same token.
This is how the agent reasons across many Books without loading the whole organization into the prompt. It asks the Books list for the facts it needs, lets the server filter and sort, and runs Python over the result. See Book data.
Web search
On GPT models, the agent searches the web when a question needs something current or outside your data: news, rates, a company, a regulation. Each search shows as a step with its query, and opens to the pages it read. The answer cites what it used as links to those pages. Searches count toward the chat’s credits. Gemini models do not search.LendSaaS
When your organization has connected LendSaaS, the agent can read it in every chat: leads, offers, underwriting status and history, stips, funding, payments, fees, syndication and more. It can answer questions that need both systems, such as what was offered on the deals whose statements showed falling revenue, joining a Book to its lead by the lead’s id. Access is read-only, enforced in three places:- The agent calls a Pathway proxy, not LendSaaS. The proxy only accepts
GETrequests. - The proxy forwards only the reads in LendSaaS’s own read-only API. Any other address, including every part of LendSaaS’s write API, is refused before anything is sent.
- The agent’s token is read-only, so Pathway’s own LendSaaS actions (create a deal, push worksheets, change a status) refuse it too.
Gmail
When you connect Gmail, the agent reads your inbox through a read-only proxy, using the same API token. The proxy only acceptsGET requests, so reading is read-only by design. Any Gmail read works through it: search messages, fetch a message or thread, list labels, download an attachment.
pandas, a PDF gets inspected with view, an invoice image gets read visually by the model.
Sending is the one exception. It runs through the send_email tool, which composes a message and attaches sandbox files, and the user must approve it before it goes out.
Book data
The agent reads Books from the Pathway API at three depths, and picks the lightest one that answers the question.- Metrics across Books
- Computed analytics
- Raw parser output
Every parsed Book saves its metrics: about 290 named facts (revenue, balances, debt, the business, its owners, the application, the selected offer) and its screening verdict. These are the same facts screening rules, contracts, and the Books table use.
GET /api/books/ returns the facts a request names, and filters and sorts on any of them, so a question over thousands of Books is one request:The parser owns the structured Book. The agent works on top of it. It does not replace deterministic parsing, reconciliation, or analytics. It gives you a way to ask new questions and produce new artifacts without waiting for a new product workflow.
Widgets
With Widgets on, the agent can draw an interactive React component in the chat: a chart you can hover, a table you can sort, a small calculator. It uses the app’s own theme, so it matches light and dark mode. A widget runs in your browser in a sandboxed frame with no network access. It cannot call the Pathway API and it never holds a token. The agent reads and computes in its sandbox first, then writes the result into the widget, so a widget is a picture of the data at the moment it was made. For the full data behind one, ask for a file.Artifacts and the asset proxy
Every file in the platform lives in S3 and is served through one endpoint:/api/assets/{s3_key}. The key holds an unguessable UUID, so the endpoint needs no separate login. It signs a short-lived URL and returns a redirect.
The frontend receives a URL, checks the mime type, and renders the matching preview: images inline, PDFs in a viewer, HTML in a sandboxed iframe, Excel in Office Online, everything else as a download link. It does not distinguish between a chart the agent just made and a spreadsheet the parser produced. Both are just files behind the same proxy.
For Excel files, adding
?embed=office returns a fresh Office Online embed URL instead of a redirect. This powers the interactive spreadsheet previews in chat, in the Book’s spreadsheet tab, and in the embed API.State
Two things hold the state of a chat: the sandbox filesystem and the conversation history. Files on disk, messages in the database. That is the whole system. A shell, a filesystem, and two additions on top:save_artifact to publish a file, and view to let the agent see one. Simple primitives that compose into the work.