Skip to content
项目

关于

Mango Client - More than just mangoes🥭. Your ideas, in full juice🧃.

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Mango Client for Geothermal Analysis

Mango Client logo

Mango Client

A geothermal analytics agent: ask it questions, hand it documents, and have it run real reservoir simulations - all from one chat window.

What it is

Mango Client pairs a Next.js chat UI with a FastAPI backend running a ReAct-style LLM agent. The agent isn't just a wrapper around a language model - it has two Model Context Protocol (MCP) tool servers behind it: one that drives an actual Julia/JutulDarcy reservoir simulator (Fimbul.jl) for geothermal cases (ATES, EGS, doublets, and more), and one that runs hybrid retrieval over a LanceDB knowledge base built from the documents you upload. Note that the Mango Client supports documents upload with extensions of .docx, .xslx, .pptx, .pdf, .txt, .md, .html, .htm, png, .jpg, .jpeg.

See arch.md for the full request lifecycle and process model, and examples/sim.md for what each simulation case's output looks like.

Designs

Tool-augmented scientific reasoning system: The language model is treated primarily as an orchestration and reasoning layer. Whenever a query requires reservoir modelling or quantitative geothermal analysis, the system delegates the computation to dedicated simulation tools.

Modular Tool-Mediated Architecture: Domain capabilities are exposed to the agent through well-defined tool interfaces rather than being embedded directly within the language-model layer. The use of the Model Context Protocol (MCP) establishes a clear abstraction boundary between conversational reasoning and external computational services.

Explicit Separation of Reasoning and Execution:Mango Client follows an iterative reasoning-and-action workflow in which the agent may reason about a problem, invoke one or more tools, observe their outputs, and subsequently refine its response. This structure allows complex analytical tasks to be decomposed into a sequence of explicit computational operations rather than compressed into a single model invocation.

Preview

Preview for Mango Client

example for Mango Client

Location of Utah Forge

Architecture

client/  (Next.js, useChat)
   │  SSE: metadata / thought / token / error / done
   ▼
src/term.py  (FastAPI, ReAct loop)
   ├── fimbul_server.py  (MCP, stdio) ── fimbul_sim.jl (persistent Julia subprocess)
   └── rag_server.py     (MCP, stdio) ── ingest.py (fresh subprocess per file)

Full details, including the sequence diagram this is simplified from, are in arch.md.

Installation

Prerequisites

  • Python 3.11+ for the backend and fimbul.jl
  • A separate Python 3.13 environment for rag_server (its heavy ML dependencies - Docling, transformers, pix2tex - are deliberately kept out of the main environment)
  • Julia via juliaup, for the Fimbul reservoir simulator
  • Node.js + pnpm for the frontend

Backend

pip install .

Create a .env file at the repo root with at least:

OPENAI_API_KEY=...
LLM_MODEL=YOUR_MODEL_NAME          
WEB_SEARCH_API_KEY=...          

See src/config.py for every setting and its default.

Fimbul / Julia simulator

./fimbul.bash

Clones Fimbul.jl into packages/, dev-links it into julia/'s Julia project, and precompiles. This is a one-time step (subsequent edits to packages/Fimbul.jl are picked up automatically on next run).

RAG server (isolated environment)

cd src/server/rag_server
python -m venv .venv
.venv\Scripts\activate          # Windows; `source .venv/bin/activate` elsewhere
pip install -r requirements.txt

Frontend

cd client
pnpm install
cp .env.example .env.local

Fill in .env.local - at minimum MANGO_CLIENT_API_URL (defaults to http://localhost:8000), AUTH_SECRET, and POSTGRES_URL.

Running locally

# terminal 1 - backend (also spawns fimbul_server and rag_server as MCP subprocesses)
cd src
python -m uvicorn term:app --host 127.0.0.1 --port 8000

# terminal 2 - frontend
cd client
pnpm dev

Open http://localhost:3000. The backend's health check is at http://localhost:8000/mango_client/health.

Acknowledgements

The chat frontend is adapted from Vercel's ai-chatbot template. Reservoir simulation is powered by SINTEF's Fimbul.jl, built on JutulDarcy.jl. Tool orchestration between the agent and its simulation/retrieval backends follows the Model Context Protocol spec. Interactive charts are rendered with Plotly, and the 3D site map uses CesiumJS. We're also grateful to Harsuko, R., Bi, Z., Chen, G., & Nakata, N. (2026). Source code for Geothermal Analytics and Intelligent Agent (GAIA) [Computer software]. https://doi.org/10.5281/zenodo.20601438 - the UI layout is inspired and adapted from their work.

License

See LICENSE MIT.

探索相关项目

加载中…