Skip to content

Commit e0d7af5

Browse files
Merge remote-tracking branch 'upstream/develop' into feature/hf-24-stringify-currency
# Conflicts: # docs/guide/known-limitations.md
2 parents e175670 + 508d78f commit e0d7af5

19 files changed

Lines changed: 5525 additions & 313 deletions

.github/workflows/lint.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ jobs:
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030

31-
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
31+
- name: Checkout main repository
32+
uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598 # https://github.com/actions/checkout/releases/tag/v2.0.0
33+
34+
- name: Checkout hyperformula-tests repository
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
36+
with:
37+
ssh-key: ${{ secrets.DEPLOY_TOKEN }}
38+
repository: handsontable/hyperformula-tests
39+
path: test/hyperformula-tests
40+
41+
- name: Fetch hyperformula-tests and sync branches
42+
run: cd test && ./fetch-tests.sh
3243

3344
- name: Install dependencies
3445
run: npm ci

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77

88
## [Unreleased]
99

10+
## [3.3.0] - 2026-05-20
11+
1012
### Added
1113

1214
- Added 12 database functions: DCOUNT, DSUM, DAVERAGE, DMAX, DMIN, DGET, DPRODUCT, DCOUNTA, DSTDEV, DSTDEVP, DVAR, DVARP. [#1652](https://github.com/handsontable/hyperformula/pull/1652)

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ module.exports = {
216216
['/guide/integration-with-vue', 'Integration with Vue'],
217217
['/guide/integration-with-angular', 'Integration with Angular'],
218218
['/guide/integration-with-svelte', 'Integration with Svelte'],
219-
['/guide/ai-sdk', 'HyperFormula AI SDK'],
219+
['/guide/ai-sdk', 'Integration with Vercel AI SDK'],
220220
['/guide/integration-with-langchain', 'Integration with LangChain'],
221221
['/guide/mcp-server', 'HyperFormula MCP Server'],
222222
]

docs/guide/ai-sdk.md

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,67 @@
1-
# HyperFormula AI SDK
1+
# HyperFormula AI SDK for Vercel
22

3-
Let LLMs safely read/write spreadsheets and compute formulas via a deterministic engine.
3+
A [Vercel AI SDK](https://sdk.vercel.ai/docs) tool that gives your agents deterministic spreadsheet and formula computation — backed by HyperFormula's Excel-compatible engine.
4+
5+
::: warning Not available yet — coming soon
6+
This integration is on our roadmap and **cannot be installed or used today**. The API shown below is a preview and may still change before the first release.
7+
8+
If you'd like to try it, [join the early access list](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA) — we'll ping you the moment the first beta is ready, and your sign-up directly tells us how strongly to prioritize this integration.
9+
:::
410

511
## What it does
612

7-
- **Evaluate formulas on the fly** —call `calculateFormula()` to evaluate any Excel-compatible formula without placing it in a cell.
8-
- **Read and write cells and ranges** —get or set individual cells and multi-cell ranges so an LLM can inspect, populate, or modify sheet data programmatically.
9-
- **Trace dependencies** —call `getCellDependents()` and `getCellPrecedents()` to understand which cells feed into a formula and what downstream values would change.
13+
- **Evaluate formulas deterministically** — your agent runs any Excel-compatible formula through HyperFormula instead of asking the LLM to do math. Results are exact, reproducible, and auditable.
14+
- **Read and write cells and ranges** — the agent inspects, populates, or modifies sheet data through typed tool calls.
15+
- **Trace dependencies** — precedents and dependents are surfaced so the agent can explain how every value was derived.
16+
- **400+ built-in functions out of the box** — the agent has access to the full Excel-compatible function set (`SUM`, `VLOOKUP`, `IRR`, `INDEX/MATCH`, and the rest), no implementation work required.
1017

11-
## Quickstart
18+
## Example
19+
20+
Using HyperFormula as a tool inside the Vercel AI SDK:
1221

1322
```js
23+
import { generateText } from 'ai';
24+
import { openai } from '@ai-sdk/openai';
1425
import HyperFormula from 'hyperformula';
1526
import { createSpreadsheetTools } from 'hyperformula/ai';
1627

17-
// 1. Create a HyperFormula instance with initial data
28+
// Build a workbook your agent can reason about.
1829
const hf = HyperFormula.buildFromArray([
1930
['Revenue', 100],
2031
['Cost', 60],
2132
['Profit', '=B1-B2'],
2233
]);
2334

24-
// 2. Create tools your LLM agent can call
25-
const tools = createSpreadsheetTools(hf);
26-
27-
// 3. Agent interaction examples
28-
tools.evaluate({ formula: '=IRR({-1000,300,400,500,200})' });
29-
// → 0.1189 — deterministic, no LLM math
30-
31-
tools.setCellContents({ sheet: 0, col: 1, row: 0, value: 200 });
32-
tools.getRange({ sheet: 0, startCol: 0, startRow: 0, endCol: 1, endRow: 2 });
33-
// → [['Revenue', 200], ['Cost', 60], ['Profit', 140]]
34-
35-
// Agent: "What drives the profit number?"
36-
tools.getDependents({ sheet: 0, col: 1, row: 0 });
37-
// → [{ sheet: 0, col: 1, row: 2 }] — Revenue flows into Profit
35+
// Pass the spreadsheet tools straight into generateText.
36+
const result = await generateText({
37+
model: openai('gpt-4o'),
38+
tools: createSpreadsheetTools(hf),
39+
prompt: 'What drives the profit number, and what happens if revenue doubles?',
40+
});
3841
```
3942

43+
A single import, one extra line in `tools`, and the model can evaluate formulas, read ranges, and edit cells through the SDK — without inventing numbers.
44+
4045
## Use cases
4146

42-
- **Explain a sheet** —ask an agent to summarize what a spreadsheet does, which cells are inputs, and how outputs are derived.
43-
- **Generate a what-if scenario** —let the model tweak assumptions (price, volume, rate) and observe how results change in real time.
44-
- **Validate and clean data** —have the agent scan ranges for errors, missing values, or inconsistencies and fix them with formulas or direct edits.
45-
- **Create formulas from natural language** —describe a calculation in plain English and let the model write and verify the correct Excel formula.
47+
- **Explain the spreadsheet** — ask the agent what a workbook does, which cells are inputs, and how each output is derived; get answers grounded in real formula evaluation.
48+
- **What-if scenarios and forecasting** — the agent tweaks assumptions and reports how downstream results change, deterministically.
49+
- **Validate and clean data** — the agent scans ranges for errors, missing values, or inconsistencies and fixes them in place.
50+
- **Generate formulas from natural language** — the agent translates a plain-English calculation into a verified, working Excel formula.
51+
- **Financial modeling and reporting** — NPV, IRR, amortization, KPI rollups, and other quantitative workflows where the answer must be exact and auditable.
52+
53+
## Get early access
4654

47-
## Beta access
55+
::: tip Be the first to try it
56+
We're actively building this integration. Drop your email and we'll notify you the moment the first beta lands — so you can try it before the public release.
4857

49-
::: tip
50-
[Sign up for beta access](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
58+
[Join the early access list →](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
5159
:::
60+
61+
## Links
62+
63+
- [Vercel AI SDK documentation](https://sdk.vercel.ai/docs)
64+
- [HyperFormula on GitHub](https://github.com/handsontable/hyperformula)
65+
- [HyperFormula on npm](https://www.npmjs.com/package/hyperformula)
66+
- [Built-in functions](built-in-functions.md)
67+
- [Custom functions](custom-functions.md)

docs/guide/custom-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ it('returns a VALUE error if the range argument contains a string', () => {
358358
359359
## Working demo
360360
361-
Explore the full working example on <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.2.x/custom-functions?v=' + $page.buildDateURIEncoded">Stackblitz</a>.
361+
Explore the full working example on <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.3.x/custom-functions?v=' + $page.buildDateURIEncoded">Stackblitz</a>.
362362
363363
This demo contains the implementation of both the
364364
[`GREET`](#add-a-simple-custom-function) and

docs/guide/integration-with-angular.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ The service above is already SSR-safe — HyperFormula has no browser-only API d
124124

125125
## Demo
126126

127-
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.2.x/angular-demo?v=' + $page.buildDateURIEncoded">Angular demo on Stackblitz</a>.
127+
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.3.x/angular-demo?v=' + $page.buildDateURIEncoded">Angular demo on Stackblitz</a>.
Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,71 @@
11
# Integration with LangChain/LangGraph
22

3-
A LangChain/LangGraph tool that gives AI agents deterministic, Excel-compatible formula evaluation instead of relying on LLM-generated math.
3+
A [LangChain.js](https://js.langchain.com/) / [LangGraph](https://langchain-ai.github.io/langgraphjs/) tool that gives your agents deterministic spreadsheet and formula computation — backed by HyperFormula's Excel-compatible engine.
44

5-
## What it does
6-
7-
**Without HyperFormula:**
8-
9-
```python
10-
result = llm.invoke(
11-
"Calculate the IRR for these cash flows: [-1000, 300, 400, 500, 200]"
12-
)
13-
# "The IRR is approximately 12.4%" ← non-deterministic, unverifiable
14-
```
15-
16-
**With HyperFormula tool:**
17-
18-
```python
19-
from langchain_core.tools import tool
20-
from hyperformula import HyperFormula
21-
22-
hf = HyperFormula.build_from_array([[-1000, 300, 400, 500, 200]])
5+
::: warning Not available yet — coming soon
6+
This integration is on our roadmap and **cannot be installed or used today**. The API shown below is a preview and may still change before the first release.
237

24-
@tool
25-
def evaluate_formula(formula: str) -> str:
26-
"""Evaluate an Excel-compatible formula using HyperFormula."""
27-
return hf.calculate_formula(formula, sheet_id=0)
8+
If you'd like to try it, [join the early access list](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA) — we'll ping you the moment the first beta is ready, and your sign-up directly tells us how strongly to prioritize this integration.
9+
:::
2810

29-
agent = create_react_agent(llm, [evaluate_formula])
11+
## What it does
3012

31-
# Agent calls: evaluate_formula("=IRR(A1:E1)")
32-
# → 0.1189 ← deterministic, auditable
13+
- **Evaluate formulas deterministically** — your agent runs any Excel-compatible formula through HyperFormula instead of asking the LLM to do math. Results are exact, reproducible, and auditable.
14+
- **Read and write cells and ranges** — the agent inspects, populates, or modifies sheet data through typed tool calls.
15+
- **Trace dependencies** — precedents and dependents are surfaced so the agent can explain how every value was derived.
16+
- **400+ built-in functions out of the box** — the agent has access to the full Excel-compatible function set (`SUM`, `VLOOKUP`, `IRR`, `INDEX/MATCH`, and the rest), no implementation work required.
17+
18+
## Example
19+
20+
Wiring HyperFormula into a LangGraph ReAct agent:
21+
22+
```js
23+
import { ChatOpenAI } from '@langchain/openai';
24+
import { createReactAgent } from '@langchain/langgraph/prebuilt';
25+
import HyperFormula from 'hyperformula';
26+
import { createSpreadsheetTools } from 'hyperformula/langchain';
27+
28+
const hf = HyperFormula.buildFromArray([
29+
['Revenue', 100],
30+
['Cost', 60],
31+
['Profit', '=B1-B2'],
32+
]);
33+
34+
const agent = createReactAgent({
35+
llm: new ChatOpenAI({ model: 'gpt-4o' }),
36+
tools: createSpreadsheetTools(hf),
37+
});
38+
39+
await agent.invoke({
40+
messages: [
41+
{ role: 'user', content: 'What drives the profit number, and what happens if revenue doubles?' },
42+
],
43+
});
3344
```
3445

35-
## How it works
36-
37-
1. **Agent populates a HyperFormula sheet** —writes data and formulas (`=SUM`, `=IF`, `=VLOOKUP`, etc.) into cells.
38-
2. **HyperFormula evaluates deterministically** —resolves the full dependency graph using 400+ built-in functions. No LLM in the loop for math.
39-
3. **Agent continues with verified data** —computed values flow back into the chain for reasoning, reporting, or downstream actions.
46+
A single import, one entry in `tools`, and the agent can evaluate formulas, read ranges, and edit cells through LangChain — without inventing numbers.
4047

4148
## Use cases
4249

43-
- Financial modeling (NPV, IRR, amortization)
44-
- Data transformation and aggregation (SUMIF, VLOOKUP)
45-
- Dynamic pricing with formula-defined logic
46-
- What-if scenarios and forecasting
47-
- Report generation with verified KPIs
50+
- **Explain the spreadsheet** — ask the agent what a workbook does, which cells are inputs, and how each output is derived; get answers grounded in real formula evaluation.
51+
- **What-if scenarios and forecasting** — the agent tweaks assumptions and reports how downstream results change, deterministically.
52+
- **Validate and clean data** — the agent scans ranges for errors, missing values, or inconsistencies and fixes them in place.
53+
- **Generate formulas from natural language** — the agent translates a plain-English calculation into a verified, working Excel formula.
54+
- **Financial modeling and reporting** — NPV, IRR, amortization, KPI rollups, and other quantitative workflows where the answer must be exact and auditable.
4855

49-
## Beta access
56+
## Get early access
5057

51-
::: tip
52-
[Sign up for beta access](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
58+
::: tip Be the first to try it
59+
We're actively building this integration. Drop your email and we'll notify you the moment the first beta lands — so you can try it before the public release.
60+
61+
[Join the early access list →](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
5362
:::
63+
64+
## Links
65+
66+
- [LangChain.js documentation](https://js.langchain.com/)
67+
- [LangGraph documentation](https://langchain-ai.github.io/langgraphjs/)
68+
- [HyperFormula on GitHub](https://github.com/handsontable/hyperformula)
69+
- [HyperFormula on npm](https://www.npmjs.com/package/hyperformula)
70+
- [Built-in functions](built-in-functions.md)
71+
- [Custom functions](custom-functions.md)

docs/guide/integration-with-react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ In the Pages Router, the same `dynamic(..., { ssr: false })` call works directly
114114

115115
## Demo
116116

117-
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.2.x/react-demo?v=' + $page.buildDateURIEncoded">React demo on Stackblitz</a>.
117+
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.3.x/react-demo?v=' + $page.buildDateURIEncoded">React demo on Stackblitz</a>.

docs/guide/integration-with-svelte.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ In SvelteKit, top-level statements in `<script>` run on the server too. HyperFor
123123
124124
## Demo
125125
126-
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.2.x/svelte-demo?v=' + $page.buildDateURIEncoded">Svelte demo on Stackblitz</a>.
126+
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.3.x/svelte-demo?v=' + $page.buildDateURIEncoded">Svelte demo on Stackblitz</a>.

docs/guide/integration-with-vue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const hfInstance = markRaw(
113113

114114
## Demo
115115

116-
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.2.x/vue-3-demo?v=' + $page.buildDateURIEncoded">Vue 3 demo on Stackblitz</a>.
116+
For a more advanced example, check out the <a :href="'https://stackblitz.com/github/handsontable/hyperformula-demos/tree/3.3.x/vue-3-demo?v=' + $page.buildDateURIEncoded">Vue 3 demo on Stackblitz</a>.
117117

118118
::: tip
119119
This demo uses the [Vue 3](https://v3.vuejs.org/) framework. If you are looking for an example using Vue 2, check out the [code on GitHub](https://github.com/handsontable/hyperformula-demos/tree/2.5.x/vue-demo).

0 commit comments

Comments
 (0)