Jokerwoo780/Mango_Client
حول
Mango Client - More than just mangoes🥭. Your ideas, in full juice🧃.
تطوير الويب والتطبيقاتالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلMango Client for Geothermal Analysis
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
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.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…