Skip to content

Commit 357eee3

Browse files
GreenFluxclaudesequba
authored
Add AI integration docs and reorganize sidebar (#1644)
## Summary - Add three new landing pages under Framework integration: HyperFormula AI SDK, Integration with LangChain/LangGraph, and HyperFormula MCP Server - Rename sidebar "Overview" section to "About" and move it above Miscellaneous (2nd to last) - Promote "Getting started" to second position in sidebar (right after Introduction) ## Test plan - [ ] Run `npm run docs:dev` and verify sidebar order: Introduction → Getting started → Framework integration → ... → About → Miscellaneous - [ ] Verify new pages render at `/guide/ai-sdk`, `/guide/integration-with-langchain`, `/guide/mcp-server` - [ ] Verify existing Overview pages (Quality, Supported browsers, etc.) still accessible at original URLs <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: documentation-only changes that add new guide pages and reorder sidebar navigation without affecting runtime code. > > **Overview** > Adds three new guide pages describing AI-focused integrations: `ai-sdk`, `integration-with-langchain`, and `mcp-server`. > > Reorganizes the VuePress sidebar by renaming the prior *Overview* section to **About**, moving it near the end, and renaming *Framework integration* to **Integrations** while linking in the new AI docs pages. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1688f23. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com>
1 parent ca0bb89 commit 357eee3

File tree

4 files changed

+163
-12
lines changed

4 files changed

+163
-12
lines changed

docs/.vuepress/config.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,6 @@ module.exports = {
175175
['/guide/demo', 'Demo'],
176176
]
177177
},
178-
{
179-
title: 'Overview',
180-
collapsable: false,
181-
children: [
182-
['/guide/quality', 'Quality'],
183-
['/guide/supported-browsers', 'Supported browsers'],
184-
['/guide/dependencies', 'Dependencies'],
185-
['/guide/licensing', 'Licensing'],
186-
['/guide/support', 'Support'],
187-
]
188-
},
189178
{
190179
title: 'Getting started',
191180
collapsable: false,
@@ -199,13 +188,16 @@ module.exports = {
199188
]
200189
},
201190
{
202-
title: 'Framework integration',
191+
title: 'Integrations',
203192
collapsable: false,
204193
children: [
205194
['/guide/integration-with-react', 'Integration with React'],
206195
['/guide/integration-with-vue', 'Integration with Vue'],
207196
['/guide/integration-with-angular', 'Integration with Angular'],
208197
['/guide/integration-with-svelte', 'Integration with Svelte'],
198+
['/guide/ai-sdk', 'HyperFormula AI SDK'],
199+
['/guide/integration-with-langchain', 'Integration with LangChain'],
200+
['/guide/mcp-server', 'HyperFormula MCP Server'],
209201
]
210202
},
211203
{
@@ -276,6 +268,17 @@ module.exports = {
276268
['/guide/migration-from-2.x-to-3.0', 'Migrating from 2.x to 3.0'],
277269
]
278270
},
271+
{
272+
title: 'About',
273+
collapsable: false,
274+
children: [
275+
['/guide/quality', 'Quality'],
276+
['/guide/supported-browsers', 'Supported browsers'],
277+
['/guide/dependencies', 'Dependencies'],
278+
['/guide/licensing', 'Licensing'],
279+
['/guide/support', 'Support'],
280+
]
281+
},
279282
{
280283
title: 'Miscellaneous',
281284
collapsable: false,

docs/guide/ai-sdk.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# HyperFormula AI SDK
2+
3+
Let LLMs safely read/write spreadsheets and compute formulas via a deterministic engine.
4+
5+
## What it does
6+
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.
10+
11+
## Quickstart
12+
13+
```js
14+
import HyperFormula from 'hyperformula';
15+
import { createSpreadsheetTools } from 'hyperformula/ai';
16+
17+
// 1. Create a HyperFormula instance with initial data
18+
const hf = HyperFormula.buildFromArray([
19+
['Revenue', 100],
20+
['Cost', 60],
21+
['Profit', '=B1-B2'],
22+
]);
23+
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
38+
```
39+
40+
## Use cases
41+
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.
46+
47+
## Beta access
48+
49+
::: tip
50+
[Sign up for beta access](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
51+
:::
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Integration with LangChain/LangGraph
2+
3+
A LangChain/LangGraph tool that gives AI agents deterministic, Excel-compatible formula evaluation instead of relying on LLM-generated math.
4+
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]])
23+
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)
28+
29+
agent = create_react_agent(llm, [evaluate_formula])
30+
31+
# Agent calls: evaluate_formula("=IRR(A1:E1)")
32+
# → 0.1189 ← deterministic, auditable
33+
```
34+
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.
40+
41+
## Use cases
42+
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
48+
49+
## Beta access
50+
51+
::: tip
52+
[Sign up for beta access](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
53+
:::

docs/guide/mcp-server.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# HyperFormula MCP Server
2+
3+
An MCP (Model Context Protocol) server that exposes HyperFormula as a tool for any MCP-compatible AI client, giving LLMs deterministic spreadsheet computation.
4+
5+
## What it does
6+
7+
- **Evaluate formulas** —any MCP client can call HyperFormula to evaluate Excel-compatible formulas and get exact results.
8+
- **Read and write cells** —get or set individual cell values and ranges through standard MCP tool calls.
9+
- **Inspect dependencies** —trace which cells a formula depends on and understand the calculation graph.
10+
11+
**Without HyperFormula:**
12+
13+
```
14+
User: What's the NPV at 8% for these cash flows?
15+
Agent: "Approximately $142.50" ← non-deterministic, unverifiable
16+
```
17+
18+
**With HyperFormula MCP server:**
19+
20+
```
21+
User: What's the NPV at 8% for these cash flows?
22+
Agent → tool call: evaluate("=NPV(0.08, B1:B5)")
23+
Agent: "$138.43" ← deterministic, auditable
24+
```
25+
26+
## How it works
27+
28+
1. **Start the MCP server** —runs HyperFormula as a local MCP server that any compatible client (Claude Desktop, Cursor, VS Code, etc.) can connect to.
29+
2. **Client sends tool calls** —the AI client calls tools like `evaluate`, `getCellValue`, and `setCellContents` via the MCP protocol.
30+
3. **HyperFormula evaluates deterministically** —resolves formulas using 400+ built-in functions with full dependency tracking. No LLM in the loop for math.
31+
4. **Results flow back to the client** —computed values return through MCP, grounding the AI's response in verified numbers.
32+
33+
## Use cases
34+
35+
- Spreadsheet Q&A in Claude Desktop or other MCP clients
36+
- Formula evaluation in IDE-based AI assistants
37+
- Financial calculations in chat-based agent workflows
38+
- Data validation and transformation via natural language
39+
40+
## Beta access
41+
42+
::: tip
43+
[Sign up for beta access](https://2fmjvg.share-eu1.hsforms.com/2e6drCkuLTn-1RuiYB91eJA)
44+
:::

0 commit comments

Comments
 (0)