This commit is contained in:
Tikhon Vodyanov 2025-08-02 13:29:43 +02:00
parent e3d416ff0e
commit 797fec3135
32 changed files with 3770 additions and 0 deletions

4
backend/.env Executable file
View file

@ -0,0 +1,4 @@
OPENAI_API_KEY=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
OPENAI_MODEL=gpt-3.5-turbo
GOOGLE_APPLICATION_CREDENTIALS="./gen-lang-client-0531051429-7455e402c041.json"

4
backend/.env.example Executable file
View file

@ -0,0 +1,4 @@
OPENAI_API_KEY=
OPENAI_MODEL=
GOOGLE_APPLICATION_CREDENTIALS=

1
backend/.gitignore vendored Executable file
View file

@ -0,0 +1 @@
node_modules/

122
backend/README.md Executable file
View file

@ -0,0 +1,122 @@
# Project Genesis Backend
This repository contains the backend service for Project Genesis, a powerful application that combines a Retrieval-Augmented Generation (RAG) system with image generation capabilities.
## Description
Project Genesis Backend is a Node.js service built with Express.js. It leverages a Qdrant vector database and LlamaIndex to provide advanced question-answering capabilities based on a custom knowledge base. The system can process and understand a variety of documents, allowing users to ask complex questions and receive accurate, context-aware answers.
Additionally, the backend integrates with Google's Vertex AI to offer powerful image generation features, allowing for the creation of visuals based on textual descriptions.
## Core Technologies
- **Backend Framework:** Node.js, Express.js
- **Vector Database:** Qdrant
- **LLM Orchestration:** LlamaIndex
- **Image Generation:** Google Vertex AI
## Configuration (.env)
Before running the application, you need to set up your environment variables. Create a `.env` file in the root of the project by copying the `.env.example` file (if one is provided) or by creating a new one.
```bash
cp .env.example .env
```
### Key Environment Variables:
- **LLM Configuration:** While the demo was built using OpenAI keys (`OPENAI_API_KEY`, `OPENAI_MODEL`), LlamaIndex is highly flexible. You can easily configure it to use any open-source or self-hosted Large Language Model (LLM) of your choice.
- **Image Generation (Google Vertex AI):** To enable image generation, you need to:
1. Set up a Google Cloud project with the Vertex AI API enabled.
2. Create a service account with the necessary permissions for Vertex AI.
3. Download the JSON key file for the service account.
4. Provide the path to this JSON key file in your `.env` file.
## Getting Started
Follow these steps to set up and run the backend service on your local machine.
### Prerequisites
- [Node.js and npm](https://nodejs.org/en/)
- [Docker](https://www.docker.com/get-started)
### 1. Clone the Repository
```bash
git clone https://github.com/GVodyanov/plant-desc-parser.git
cd plant-desc-parser
```
### 2. Install Dependencies
Install the required Node.js packages using npm:
```bash
npm install
```
### 3. Set Up Qdrant Vector Database
Qdrant is used to store the document embeddings for the RAG system. The easiest way to get it running is with Docker.
- **Download the Qdrant image:**
```bash
docker pull qdrant/qdrant
```
- **Run the Qdrant container:**
This command starts a Qdrant container and maps the port `6333` to your local machine. It also mounts a local directory (`./storage/qdrant`) to persist the vector data, ensuring your data is not lost when the container is stopped or removed.
```bash
docker run -p 6333:6333 -v $(pwd)/storage/qdrant:/qdrant/storage qdrant/qdrant
```
### 4. Create Embeddings
The knowledge base, consisting of markdown files located in the `/storage` directory, needs to be processed and stored in the Qdrant vector database.
Run the following script to create the embeddings:
```bash
node createEmbeddings.js
```
### 5. Run the Server
Once the setup is complete, you can start the Express server:
```bash
npm start
```
or
```bash
node index.js
```
The server will be running on the port specified in your `.env` file (defaults to 3000).
## Customizing the RAG Data
You can easily customize the knowledge base of the RAG system by adding your own data.
### Adding New Documents
Place your own sliced markdown files in the `/storage` directory. The `createEmbeddings.js` script will automatically process all `.md` files in this folder and its subdirectories.
### Converting Scientific PDFs to Markdown
For converting complex documents like scientific PDFs into clean markdown, we recommend using [Marker](https://github.com/datalab-to/marker). It is a powerful tool that can accurately extract text, tables, and other elements from PDFs.
### Slicing Markdown Files
After converting your documents to markdown, you need to slice them into smaller, more manageable chunks for the RAG system. This helps improve the accuracy of the retrieval process.
We recommend using the `UnstructuredMarkdownLoader` with the `mode="elements"` option for the best results. This will split the markdown file by its headers, titles, and other structural elements.
For a detailed guide on how to implement this, you can refer to the following example Colab notebook:
[LangChain Unstructured Markdown Loader Example](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/integrations/document_loaders/unstructured_markdown.ipynb)

BIN
backend/basil.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 KiB

59
backend/createEmbeddings.js Executable file
View file

@ -0,0 +1,59 @@
import 'dotenv/config';
// Setup LLM
import {Document, Settings, storageContextFromDefaults, VectorStoreIndex} from "llamaindex";
import {OpenAI, OpenAIEmbedding} from "@llamaindex/openai";
import path from "path";
import fs from "fs";
import {QdrantVectorStore} from "@llamaindex/qdrant";
// Initialize Qdrant vector store for plants
Settings.llm = new OpenAI({
model: process.env.OPENAI_MODEL,
apiKey: process.env.OPENAI_API_KEY,
});
Settings.embedModel = new OpenAIEmbedding({
apiKey: process.env.OPENAI_API_KEY,
});
const vectorStore = new QdrantVectorStore({
url: 'http://localhost:6333',
collectionName: 'plants-rag',
});
const storageContext = await storageContextFromDefaults({
vectorStore
});
try {
const storageDir = path.join(process.cwd(), 'storage', 'plants');
// Read all markdown files from the storage directory
const files = fs.readdirSync(storageDir).filter(file => file.endsWith('.md'));
const documents = [];
for (const [index, file] of files.entries()) {
console.log(`Processing file ${index + 1} of ${files.length}: ${file}`);
const filePath = path.join(storageDir, file);
const content = fs.readFileSync(filePath, 'utf-8');
documents.push(new Document({
text: content,
metadata: {
source: file
}
}));
}
// Create vector store index
await VectorStoreIndex.fromDocuments(documents, {
storageContext: storageContext
});
} catch (error) {
console.error('Error initializing plants RAG:', error);
}

View file

@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "gen-lang-client-0531051429",
"private_key_id": "7455e402c04105e236281e9c64c626ca1f52c368",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCtRlAckaeNR8dM\n924GwAZ8R3X0ong75GBc3JB53Wl6HvCN2zJ9h6aHfsAZ5vx/AYPQDUn89bvhp96k\n92pScFIjSj+fRqOEFkOFAAKSsCDSX7qFP9Ji58QV82/goKMrpG3F7078uBgccQCW\nvaNp+v9jMC6VCYuPnx3YczjlsjoE+NE8opEaxqdLdAkQB5LFh6xCI4aKYSzvjbCT\nQEMxUcpaCxSx+pwG7Sa7cUBCkWNOMS8R0nZoEaqAU2O3jTZBeRgirFfk8SK+JgDB\ntGBADOkrQNG1qGOk8qSSsPqBww4ORM0jBRE8GhXMkH2BEsJ9RXL71/Se/rxr8JO2\n3TZPJd6pAgMBAAECggEAGblaFFu1Xb6dwnnrTjo83D95rgdexTl66t5d3pG14ojs\nWosDvGoimXQCTfYiXzKY4I7QgKr0qSQUZDZNBQ8iypVvy5Qfm3D4tiqRtzhJryHC\nHZ0jfUZ+MGoTHmyKvORs3ZlRByjHf5VxKm/d7lJyjsWs7LhdjUVol2VHuaYTggA1\nnXRxd0hS2cIM0OFMSdrV1r9jUPbCjBbGdPmGpgPhNVRWZ0BTdlyvBBdTv1fd1jpc\n2TYp+2std7VFrCqKRVTZOdCX7xr2jb86zNsGxD2jniTrzrZGsmqr3Rbcqr4vbkze\npKQE7RPGu1vr5APwykF8Munou6Pta79tr/6N0CQV/wKBgQDqoRpX1z7KS0S3dVgg\nmZyieVNifgpGfmNXkSwXe+2+3CB0+lRGObasHkxoEDazDmshZ/8+qsOx7qXckSXj\n2nz4JO3k3QOD8tp4QMmWETTBxU+7LUO0heVtJzaHqDaRL2qbjcrH6B1HZv1zaIvb\n2VhnA9wXlF3uKe+1SuMZPHlXfwKBgQC9Dpd/7mDaRnqv0LNIdqPi3gBNgZh+uaVQ\nef611LbUMTdysheJKDwB9EQlhbuuk2nUKDnvAvyrs8xAATTU0dwnmqihX7T0K4/t\n6CElh8ERrv7I2All3UaYUa/Xb9GoIJxPWrgiOe7/YrqKOPKMH3BsJAbe/L6WxmG1\n+5Eig6wd1wKBgQDYu3xUC/Zqc2DEftarNnpj8uK9pmPjfjhR2T37a3TPyxMIO3zB\naep9z3cQ4XlFqVn4f9JdluwyXppDxqhTc63gomxF7oqixiBc2KvdvYMYQyVFZ6iV\nBuJJE+HhKddOAZjem/nm81ioblBM3RPkPz7T2dLizSB/ManFs6lX1G7aDQKBgQCY\neQc4VxFnmMXju8aL35snIfJOkAFj2ud3sxv4m7hkA9l7OCSBKqDS1qSLOoL2Nc95\nGoQ2vkr3U4eb6x0nsqUCj9oGZAC1l9h5f+gTs5vDXkX/xzQ1IjOILwFJF9aX6M0H\nttugRub4szBMv8bluYlaveeIuYAga5hsQ5p2ookSewKBgHutzE1hNXYSZri6F3kc\nG/t5mci0+HBVX2vBTYwkTeQFIg4cWnNWfTGK8/flf1CbS3YXmlXwYUzVuCAa2OSU\nPDWIQgNQjuhEKMeVdPzr+bHYX23/fPMKx8+X7oIxSmOOtmvHcukvpEpBVBUIyE/t\njYQP2Y7tOW+3E8Kbv9aQbDJP\n-----END PRIVATE KEY-----\n",
"client_email": "noi-990@gen-lang-client-0531051429.iam.gserviceaccount.com",
"client_id": "113837059173910035271",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/noi-990%40gen-lang-client-0531051429.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

278
backend/index.js Executable file
View file

@ -0,0 +1,278 @@
import 'dotenv/config';
import express from 'express';
import { Settings, VectorStoreIndex, storageContextFromDefaults, Document } from 'llamaindex';
import { agent } from "@llamaindex/workflow";
import timeout from 'connect-timeout';
import { OpenAI, OpenAIEmbedding } from '@llamaindex/openai';
import { QdrantVectorStore } from '@llamaindex/qdrant';
import cors from 'cors';
import * as fs from 'fs';
import generateContent from "./index_vertexai.js";
import dJSON from 'dirty-json';
// Initialize Express app
const app = express();
app.use(express.json());
app.use(timeout('8000s'));
app.use(cors());
// Setup LLM
Settings.llm = new OpenAI({
model: process.env.OPENAI_MODEL,
apiKey: process.env.OPENAI_API_KEY,
});
Settings.embedModel = new OpenAIEmbedding({
apiKey: process.env.OPENAI_API_KEY,
});
// Initialize Qdrant vector store for plants
let plantsVectorStore;
async function initializePlantsVectorStore() {
plantsVectorStore = new QdrantVectorStore({
url: 'http://localhost:6333',
collectionName: 'plants-rag',
});
}
await initializePlantsVectorStore()
const reader = (await VectorStoreIndex.fromVectorStore(plantsVectorStore)).queryTool({
metadata: {
name: 'plants_growth_book',
description: 'Use this reader to get information about plants and how they grow',
},
});
const plantsAnalyzeAgent = agent({
tools: [
reader
],
systemPrompt: `
You are a world-class botanical scientist and speculative physicist AI. Your mission is to creatively and scientifically predict the outcome of exposing a plant to various, often extreme, environmental conditions.
You MUST strictly adhere to the following rules:
1. Your primary source of truth is the provided as the plants_growth_book reader. You must prioritize information from this source as the scientific foundation for your predictions.
2. You are encouraged to use your **own general knowledge** of botany, chemistry, and physics to supplement the reader. This is crucial for interpreting novel scenarios (e.g., unusual substances, complex environmental interactions) that are not explicitly defined.
3. Your answers must be exclusively in PARSABLE JSON FORMAT. Do not include any additional text, explanations, or comments outside the JSON object.
`
})
const jsonFixerAgent = agent({
tools: [],
systemPrompt: `
You are a JSON formatting expert. Your task is to ensure that the provided JSON string is properly formatted and valid. If the input is not valid JSON, you must correct it without altering its meaning.
Out of whatever you receive, you must return a JSON object of this format:
{
"final_description_text": "...",
"image_generator_prompt": "..."
}
DO NOT INCLUDE ABSOLUTELY ANYTHING EXCEPT FOR THE RAW JSON OBJECT. It needs to be parsed.
`
})
const plantsHealerAgent = agent({
tools: [
reader
],
systemPrompt: `
You are a world-class botanical scientist and speculative physicist AI. Your mission is to provide advice on how to heal a plant that has been exposed to extreme environmental conditions.
You MUST strictly adhere to the following rules:
1. Your primary source of truth is the provided as the plants_growth_book reader. You must prioritize information from this source as the scientific foundation for your predictions.
2. You are encouraged to use your **own general knowledge** of botany, chemistry, and physics to supplement the reader. This is crucial for interpreting novel scenarios (e.g., unusual substances, complex environmental interactions) that are not explicitly defined.
`
})
/**
* Extracts the first complete JSON object from a string that might contain multiple objects
* or other text.
* @param {string} str The raw string from the API.
* @returns {string|null} The cleaned string of the first JSON object, or null if none found.
*/
function extractFirstJsonObject(str) {
let braceCount = 0;
let startIndex = -1;
for (let i = 0; i < str.length; i++) {
if (str[i] === '{') {
if (braceCount === 0) {
startIndex = i;
}
braceCount++;
} else if (str[i] === '}') {
braceCount--;
if (braceCount === 0 && startIndex !== -1) {
// We found the matching closing brace for the first opening brace.
return str.substring(startIndex, i + 1);
}
}
}
return null; // Return null if no complete object was found
}
app.post('/analyze', async (req, res) => {
const query = `
### REASONING FRAMEWORK
You must follow these steps to analyze the input:
1. **Deconstruct the Input:** Break down the "Environmental Changes & Actions" into their fundamental physical and chemical principles.
* **Example 1:** If the action is "watering with Coca-Cola," you must identify its key components: high sugar content (sucrose/fructose), high acidity (phosphoric and carbonic acid), and carbonation.
* **Example 2:** If the action is "nearby meteorite explosion," you must identify the immediate physical effects: intense thermal radiation (extreme heat), a concussive shockwave (extreme pressure), and potential ionizing radiation.
2. **Analyze the Causal Chain:** Identify the chain of **first-order, second-order, and third-order effects** on the plant.
* **First-order effects** are the immediate environmental changes (e.g., soil pH drops, air temperature skyrockets).
* **Second-order effects** are the direct impact on the plant's systems (e.g., roots can't absorb nutrients, cells are flash-boiled).
* **Third-order effects** are the final, observable morphological state (e.g., leaves are wilted and brown, the plant is vaporized).
3. **Synthesize and Quantify:** Combine all effects and factor in the "Time Period" to determine the final state and severity of the outcome. A short duration may only cause stress, while a long one could be lethal.
---
### INPUT DATA
1. Initial Plant State:
Description: ${JSON.stringify(req.body.plant_state_description)}
Details: ${JSON.stringify(req.body.plant_state_details)}
2. Environmental Changes & Actions:
Description: ${JSON.stringify(req.body.environmental_changes_description)}
Details: ${JSON.stringify(req.body.environmental_changes_details)}
3. Time Period: ${JSON.stringify(req.body.time_period)}
---
### OUTPUT INSTRUCTIONS
Based on your analysis using the REASONING FRAMEWORK, generate a single JSON object with two keys:
1. "final_description_text": A detailed but clear textual description of the final state. Explain the "why" by referencing the scientific principles you identified (e.g., "Due to extreme heat from the thermal pulse..."). This should be 2-3 sentences long.
2. "image_generator_prompt": "This MUST be a set of instructions for an AI image editor, telling it how to modify the initial photo to achieve the final state. It must be a comma-separated list of concise, actionable commands. Focus on the transformation itself, not the final picture. Use imperative verbs: 'Make...', 'Turn...', 'Add...', 'Reduce...', 'Introduce...', 'Bend...', 'Change...' Example: 'Turn the green leaves to a pale yellow, add wilting to the edges of all leaves, reduce the plant's overall bushiness by 30%, make the main stems thinner and longer, introduce small brown spots on some leaves'. Provide 5-10 clear, actionable commands."
Here's an example of the expected output format:
{
"final_description_text": "...",
"image_generator_prompt": "..."
}
DO NOT INCLUDE ABSOLUTELY ANYTHING EXCEPT FOR THE RAW JSON OBJECT. It needs to be parsable. DO NOT repeat yourself.
`
const resultString = await runQuery(query, plantsAnalyzeAgent)
console.log('🔍 Raw String Result:', resultString);
// --- NEW, MORE ROBUST CLEANING LOGIC ---
const jsonToParse = extractFirstJsonObject(resultString);
if (!jsonToParse) {
return res.status(500).json({
success: false,
error: "Could not extract any valid JSON object from the response.",
rawResponse: resultString
});
}
console.log('🔧 Extracted String for Parsing:', jsonToParse);
const parsedResult = tryParseJSON(resultString);
// BEST PRACTICE: Handle cases where the AI returns invalid JSON
if (!parsedResult) {
return res.status(500).json({
success: false,
error: "Failed to parse the extracted JSON object from the analysis service.",
rawResponse: resultString
});
}
res.json({
success: true,
result: parsedResult,
});
})
app.post('/generate', async (req, res) => {
const imageDescription = req.body[0];
const imageBase64 = req.body[1];
console.log('Image description:', imageDescription, 'Image base64 length:', imageBase64.length);
const base64Data = await generateContent(imageBase64, imageDescription)
res.json({
success: true,
result: `data:image/jpeg;base64,${base64Data}`,
});
})
app.post('/cure', async (req, res) => {
const query = `
### INPUT DATA
1. Initial Plant State:
Description: ${JSON.stringify(req.body.plant_state_description)}
Details: ${JSON.stringify(req.body.plant_state_details)}
Health Breakdown: ${JSON.stringify(req.body.health_breakdown)}
---
Based on the input data and your reader, write 4-5 sentences of advice on how to heal the plant. End every sentence with a period.
`
const resultString = await runQuery(query, plantsHealerAgent)
res.json({
success: true,
result: resultString,
});
})
// Helper function to run queries
async function runQuery(query, ragAgent) {
const response = await ragAgent.run(query);
if (process.env.LOGGING_LEVEL === '1') {
console.log('✅ Query result:', response.data.result);
}
return response.data.result;
}
// Helper to safely parse JSON
async function tryParsedJSON(jsonString) {
try {
return dJSON.parse(jsonString);
} catch (e) {
console.error('❌ JSON parsing error:', e.message);
const result = await runQuery(`Fix this JSON: ${jsonString}`, jsonFixerAgent)
console.log('🔧 Fixed JSON:', result);
return dJSON.parse(result);
}
}
// A robust function to parse JSON safely
function tryParseJSON(jsonString) {
try {
const o = JSON.parse(jsonString);
// Handle non-exception-throwing cases:
// JSON.parse(null) returns null, and other edge cases.
if (o && typeof o === "object") {
return o;
}
} catch (e) {
console.error("Error parsing JSON string:", e);
console.error("Original string was:", jsonString);
}
return null; // Return null if parsing fails
}
// Start the server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});

148
backend/index_vertexai.js Executable file
View file

@ -0,0 +1,148 @@
import 'dotenv/config'; // Load environment variables from .env file
import {GoogleAuth} from 'google-auth-library';
import {GoogleGenAI} from '@google/genai';
import * as fs from 'fs'; // Import the file system module
const inputImagePath = 'strawberry.jpg';
const msg1Text1 = {text: `Do you remember a pineapple image? show the pineapple image`};
const outputImagePath = 'strawberry_output.png';
const project = 'gen-lang-client-0531051429';
const location = 'global'; // It's best practice to use a specific region
const model = 'gemini-2.0-flash-preview-image-generation';
// --- Authentication using Service Account Key ---
const auth = new GoogleAuth({
keyFilename: './gen-lang-client-0531051429-7455e402c041.json', // <-- Path to your downloaded key file
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Initialize Vertex with your Cloud project and location
const ai = new GoogleGenAI({
vertexai: true,
project: project,
location: location,
googleAuth: auth,
});
// Define the log file path
const logFile = 'app.log';
// Set up generation config
const generationConfig = {
maxOutputTokens: 8192,
temperature: 1,
topP: 0.95,
responseModalities: ["TEXT", "IMAGE"],
safetySettings: [
{
category: 'HARM_CATEGORY_HATE_SPEECH',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_DANGEROUS_CONTENT',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_HARASSMENT',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_IMAGE_HATE',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_IMAGE_HARASSMENT',
threshold: 'OFF',
},
{
category: 'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT',
threshold: 'OFF',
}
],
};
const imageBuffer = fs.readFileSync(inputImagePath);
const imageBase64 = imageBuffer.toString('base64');
const msg1Image1 = {
inlineData: {
mimeType: 'image/jpeg',
data: imageBase64
}
};
const chat = ai.chats.create({
model: model,
config: generationConfig
});
/**
* Appends a message to the log file.
* @param {string} message The message to log.
*/
function writeToLog(message) {
fs.appendFile(logFile, message + '\n', (err) => {
if (err) {
console.error('Error writing to log file:', err);
}
});
}
async function sendMessage(message) {
const response = await chat.sendMessageStream({
message: message
});
console.log(JSON.stringify(response).substring(0, 1000));
process.stdout.write('stream result: ');
for await (const chunk of response) {
const part = chunk.candidates?.[0]?.content?.parts?.[0];
console.log(JSON.stringify(chunk).substring(0, 200));
if (chunk.text) {
process.stdout.write(chunk.text);
} else if (part && part.inlineData.data !== undefined && JSON.stringify(part).length > 100000) {
// The image data is in base64 format.
// Define the file path and name.
// Write the base64 data to a file. [2, 4, 10]
return part.inlineData.data
} else {
writeToLog(JSON.stringify(chunk));
}
}
}
export default async function generateContent(inputImageBase64, textDescription) {
return await sendMessage([
{
inlineData: {
mimeType: 'image/jpeg',
data: inputImageBase64.split(',', 2)[1]
}
},
{
text: textDescription
}
]);
}
/*
export default async function generateContent() {
await sendMessage([
msg1Image1,
msg1Text1
]);
}
generateContent()
*/

2346
backend/package-lock.json generated Executable file

File diff suppressed because it is too large Load diff

34
backend/package.json Executable file
View file

@ -0,0 +1,34 @@
{
"name": "plant-desc-parser",
"version": "1.0.0",
"description": "",
"homepage": "https://github.com/GVodyanov/plant-desc-parser#readme",
"bugs": {
"url": "https://github.com/GVodyanov/plant-desc-parser/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/GVodyanov/plant-desc-parser.git"
},
"license": "ISC",
"author": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@llamaindex/google": "^0.3.18",
"@llamaindex/ollama": "^0.1.19",
"@llamaindex/openai": "^0.4.14",
"@llamaindex/qdrant": "^0.1.29",
"@llamaindex/workflow": "^1.1.20",
"connect-timeout": "^1.9.1",
"cors": "^2.8.5",
"dirty-json": "^0.9.2",
"dotenv": "^17.2.1",
"express": "^5.1.0",
"llamaindex": "^0.11.25",
"qdrant": "^1.3.1"
}
}

View file

@ -0,0 +1,22 @@
Basil cultivation can be significantly improved through various innovative and traditional methods.
* **Hydroponic Systems:** Growing basil in soilless systems like Nutrient Film Technique (NFT) and Ebb & Flow (EBB) has shown to significantly outperform soil-based methods in growth characteristics.
* **Nutrient Film Technique (NFT):** This hydroponic method provides a continuous flow of nutrient solution over the plant roots, resulting in superior growth. In one study, NFT-grown basil reached a plant height of 40 cm compared to 28.50 cm in soil.
* **Ebb & Flow (EBB) Hydroponics:** This system periodically floods the growing medium with a nutrient solution and then allows it to drain, providing good aeration and nutrient uptake.
* **Optimized Nutrient Uptake:** Hydroponic systems allow for precise control of nutrient delivery, leading to higher absorption of nitrates, ammoniacal nitrogen, sulphates, and phosphates.
* **Enhanced Growth Parameters:** Studies show that hydroponically grown basil has greater plant height, root length, leaf size, and stem diameter compared to soil-grown plants.
* **Increased Leaf Production:** NFT systems have been shown to produce a higher number of leaves per plant (15±2) compared to soil-based systems (12±2).
* **Phytoremediation:** Hydroponically grown basil can absorb a significant amount of nutrients from the water, indicating its potential for wastewater phytoremediation.
* **Controlled Environment Agriculture (CEA):** Growing basil in controlled environments like greenhouses allows for year-round production and protection from pests and diseases.
* **Soilless Culture:** This method, which includes hydroponics and aquaponics, mitigates the effects of climate change and guarantees long-term food security.
* **Aquaponics:** This system integrates aquaculture (raising fish) with hydroponics, where fish waste provides nutrients for the plants. Basil is a popular and high-demand herb in aquaponics.
* **Ideal pH and EC Levels:** Basil grows best in soil with a pH of 6.5 to 8 and an electrical conductivity (EC) of 1.8 to 2.3.
* **Rich Soil with Good Drainage:** For soil cultivation, basil thrives in rich, moist soil with a flawless drainage system.
* **Sunlight Requirements:** Basil requires six to eight hours of daily sunlight for optimal growth.
* **Higher Yield in Hydroponics:** Studies have shown that basil can produce 1.8 kg per square meter when grown aquaponically, compared to 0.6 kg in soil.
* **Microbial Inoculants:** Similar to tomatoes, introducing beneficial microbes can enhance nutrient uptake and overall plant health.
* **Organic Fertilization:** The use of organic matter improves soil structure and provides a slow release of nutrients.
* **Precision Irrigation:** Efficient water management is crucial to avoid water stress and ensure optimal growth.
* **Pest and Disease Management:** Basil has natural nematicidal, antibacterial, fungistatic, and insecticidal properties that can be leveraged in an integrated pest management system.
* **Variety Selection:** Choosing basil varieties well-suited to the specific growing system (soil-based or hydroponic) is important.
* **Continuous Monitoring:** Regular monitoring of pH and EC levels in hydroponic systems is crucial for maintaining optimal nutrient solutions.

View file

@ -0,0 +1,22 @@
Improving lettuce yield and quality involves careful management of various factors from planting to harvesting.
* **Planting Time:** Lettuce grows best in cool weather, between 60 and 70°F, making it a prime spring and fall crop.
* **Soil Requirements:** It thrives in loose, cool, well-drained soil rich in organic matter. A pH between 6.0 and 6.8 is ideal.
* **Irrigation:** Frequent and light irrigation is effective. Drip irrigation can increase yield by about 30% compared to furrow irrigation.
* **Reducing Bolting:** To prevent premature seed production in hot weather, use bolt-resistant cultivars, plant in shady areas, use mulch to cool the soil, and provide light overhead misting.
* **Soilless Cultivation:** Simplified soilless cultivation (SSC) systems have been shown to improve yield (by 35-72%) and water use efficiency compared to traditional on-soil cultivation.
* **Hydroponics and Aeroponics:** These methods allow for precise control over nutrients and can lead to higher yields in limited spaces.
* **Controlled Environment Agriculture (CEA):** Growing lettuce in controlled environments like greenhouses enables year-round production and optimizes growing conditions.
* **Microorganism Biotechnology:** Using solutions based on beneficial microorganisms can increase crop productivity sustainably.
* **Mulching:** Applying organic mulch around young plants helps retain soil moisture and control weeds.
* **Transplanting:** Hardening off seedlings for 7-10 days before transplanting helps them acclimate to outdoor conditions.
* **Harvesting Techniques:** The "cut and come again" method, where outer leaves are harvested while leaving the central ones, allows for multiple harvests from a single plant.
* **Nutrient Management:** Balanced nutrition is key. While nitrogen is crucial, an excess can lead to poor quality.
* **Crop Rotation:** Rotating lettuce with other crops helps maintain soil fertility and reduce pest and disease pressure.
* **Pest and Disease Control:** Proper spacing and good air circulation can prevent fungal diseases. Natural remedies can be used for pests.
* **Variety Selection:** Choosing lettuce varieties that are well-suited to the local climate and growing season is important.
* **Soil Amendments:** Adding compost or well-rotted manure a week before planting improves soil structure and provides essential nutrients.
* **Watering Time:** Watering in the early morning or late afternoon is recommended to reduce evaporation.
* **Fertigation:** Applying fertilizers through the irrigation system (fertigation) is more efficient than broadcasting.
* **Shade Management:** Using shade cloth or planting under taller crops can protect lettuce from excessive heat and delay bolting.
* **Post-Harvest Handling:** Soaking harvested lettuce in cold water for about 30 minutes can help maintain its freshness.

View file

@ -0,0 +1,22 @@
To boost mint production and quality, a combination of traditional and modern techniques can be employed.
* **Fertilization:** Apply a liquid organic fertilizer every three weeks from mid-spring to late summer. For winter harvesting, fertilize every six weeks from fall to early spring.
* **NPK Fertilizer:** A 16-16-16 NPK fertilizer is effective for mint plant growth without reducing the production of flavorful mint oil.
* **Composting:** Adding a layer of compost to the soil before planting provides essential nutrients. A 3-inch layer is recommended for garden planting, and a 2-inch layer for pots.
* **Irrigation Management:** Mint requires frequent and adequate irrigation, especially during summer. Watering at least three times a week helps maintain soil moisture.
* **Pruning and Harvesting:** Frequent pruning and harvesting encourage new, succulent growth. Pinching off flowers extends the harvesting cycle.
* **Soil Requirements:** Mint thrives in well-drained loam or sandy loam soils rich in organic matter, with a pH between 6.0 and 8.2.
* **Propagation:** Mint can be propagated vegetatively through stolons and runners.
* **Planting Time:** In northern India, the ideal planting time is from the first week of February to the second week of March.
* **Nursery Preparation:** For delayed sowing, preparing plants in a nursery and transplanting them can yield good results.
* **Weed Control:** Keeping the crop weed-free is essential, especially in the beginning, to ensure the main crop utilizes the available nutrients.
* **Pest Management:** Pests like leaf-folding caterpillars and termites can damage the crop. Using organic insecticides can help in their control.
* **Plant Growth Regulators (PGRs):** The application of PGRs like Gibberellic acid (GA3) can enhance herb and oil yield.
* **Controlled Environment Agriculture (CEA):** Growing mint in a controlled environment can optimize growing conditions and protect against pests and diseases.
* **Hydroponics and Aeroponics:** These soilless cultivation methods can lead to faster growth and higher yields.
* **Nutrient Solution Optimization:** In hydroponics, using an optimal concentration of nutrient solution can increase soluble sugar content.
* **Waterlogging Avoidance:** Providing adequate drainage is crucial, especially during the rainy season. Cultivating on ridges is preferable in heavy soils.
* **Mulching:** Applying leaf mulches can reduce the frequency of irrigation.
* **Post-Harvest Processing:** After harvesting, drying the crop lightly in the shade and then extracting the oil through distillation is recommended.
* **Sunlight Exposure:** Mint grows well in both full sun and partial shade. In hot climates, partial shade is beneficial.
* **Container Growing:** When growing in containers, ensure the pot is large enough to prevent the plant from becoming root-bound and provide good drainage.

View file

@ -0,0 +1,22 @@
Rosemary cultivation can be optimized for both fresh/dry stem and essential oil production through various techniques.
* **Soil Requirements:** Rosemary thrives in well-drained sandy loam soils but can tolerate clay loam with less than 25% clay. The ideal pH is between 5.5 and 8.9.
* **Propagation:** The most efficient propagation method is through cuttings from growing stem tips. Layering is also a viable option.
* **Irrigation:** While drought-tolerant once established, rosemary requires irrigation during the initial planting stage. Over-irrigation should be avoided.
* **Controlled Drought:** Applying moderate water stress for three weeks before harvesting can increase the yield of essential oil by up to 30%.
* **Fertilization:** Applying organic fertilizers or a balanced NPK fertilizer based on soil tests can improve growth. Seaweed fertilizers have been shown to significantly increase oil amount and leaf area.
* **Weed Control:** Hand weeding and hoeing are important for controlling weeds, which can affect the quality and yield of essential oil.
* **Hydroponic and Aeroponic Systems:** Growing rosemary in soilless systems allows for faster growth and higher yields due to optimal oxygenation and nutrient absorption. It can also lead to higher concentrations of bioactive compounds.
* **Nutrient Solution for Hydroponics:** In hydroponics, a nutrient solution rich in calcium and magnesium is preferred. The EC range should be between 1.0 and 1.6, and the pH between 5.5 and 6.0.
* **Lighting:** Rosemary requires at least 6-8 hours of full sun daily.
* **Air Circulation:** Good air circulation is crucial, especially when grown indoors, to prevent issues related to high humidity and stagnant air.
* **Mulching:** Mulching around the base of the plant can help retain moisture.
* **Pruning:** Pruning away dead foliage and stray branches keeps the bush healthy.
* **Organic Amendments:** The use of cow manure has been shown to improve plant height, number of branches, and the quality of the essential oil.
* **Biofertilizers:** The application of biofertilizers containing microorganisms like *Azotobacter chroococcum* and *Pseudomonas fluorescens* can increase the number of stems per plant.
* **Variety Selection:** Choosing the right rosemary cultivar is crucial as different genotypes show significant differences in oil composition and yield.
* **Extraction Methods:** The method of essential oil extraction, such as hydrodistillation, affects the final yield and quality. Pre-treatment like crushing the plant material can improve yield.
* **Planting Density:** Higher planting density, when combined with appropriate fertilization, can increase essential oil content and yield.
* **Harvesting Time:** Harvesting should be done before the plants flower for the best flavor and aroma.
* **Clonal Micropropagation:** This technique can produce virus-free, genetically uniform plants with enhanced bioactive compound content, especially when combined with hydroponic cultivation.
* **Planting Location:** Choosing a location with good drainage and ample sunlight is paramount for successful rosemary cultivation.

View file

@ -0,0 +1,22 @@
A variety of techniques can be implemented to maximize strawberry yield and improve fruit quality.
* **Soil Preparation:** Strawberries thrive in well-drained, loamy soils with a pH between 5.5 and 6.8. Amending the soil with organic matter like compost or manure is beneficial.
* **Raised Beds:** This cultivation method improves drainage, root aeration, and increases sunlight exposure, leading to better yield and quality.
* **Irrigation:** Drip irrigation is highly effective as it delivers water directly to the roots, reducing water waste and the risk of foliar diseases.
* **Nutrient Management:** Balanced application of nitrogen, phosphorus, and potassium is crucial. Soil and tissue analysis can help tailor nutrient applications.
* **Controlled-Release Fertilizers:** These provide a steady supply of nutrients over time, matching the plant's needs.
* **Foliar Feeding:** Applying nutrients directly to the leaves can quickly address deficiencies, especially during critical growth stages.
* **Mulching:** Applying mulch like straw helps conserve soil moisture, control weeds, and keep the fruit clean.
* **Runner Management:** Removing runners encourages the mother plant to develop more crowns and flower stalks, leading to a larger crop.
* **Blossom Removal:** In the first year of June-bearing strawberries, removing blossoms promotes root and runner development for a larger yield the following year.
* **Pest and Disease Control:** Using resistant varieties, crop rotation, and integrated pest management strategies are essential.
* **Precision Agriculture:** Technologies like GPS and remote sensing can optimize farming practices and improve resource management.
* **Vertical Farming and Hydroponics:** These soilless methods allow for high-density planting and year-round production, especially in urban areas.
* **Greenhouse Cultivation:** Growing strawberries in greenhouses extends the production season and protects plants from harsh weather and pests.
* **Pollination:** Attracting bees and other pollinators is essential for good fruit set.
* **Variety Selection:** Choosing varieties adapted to the local climate and desired harvest season (June-bearing, everbearing, or day-neutral) is critical.
* **Sunlight:** Strawberries require at least six hours of direct sunlight per day for optimal growth and fruit development.
* **Planting Depth:** The crown of the strawberry plant must remain above the soil surface to prevent rot and ensure good performance.
* **Weed Control:** Frequent cultivation, especially in new plantings, is important to eliminate competition from weeds.
* **Soilless Cultivation Systems:** Micropropagated mother plants grown in soilless systems show a significantly higher stoloniferous potential, leading to more propagules for nursery production.
* **Sustainable Practices:** Using organic farming methods, reducing pesticide use, and conserving water are crucial for the long-term sustainability of strawberry production.

View file

@ -0,0 +1,22 @@
Tomatoes benefit from a variety of techniques to enhance their growth, yield, and overall quality.
* **Integrated Nutrient Management (INM):** This comprehensive strategy combines organic and inorganic nutrient sources for optimal plant health.
* **Organic Fertilizers:** Using compost, manure, and crop residues improves soil structure, water retention, and microbial activity. The gradual release of nutrients aligns with the plant's growth patterns.
* **Inorganic Fertilizers:** Judicious use of synthetic fertilizers based on soil analysis addresses specific nutrient deficiencies without overloading the soil.
* **Crop Rotation and Diversification:** Rotating tomatoes with other crops breaks pest and disease cycles and enhances soil fertility.
* **Microbial Inoculants:** Introducing beneficial microorganisms like mycorrhizal fungi and nitrogen-fixing bacteria improves nutrient uptake.
* **Improved Nutrient Use Efficiency:** INM minimizes nutrient losses, ensuring a higher percentage of applied nutrients are utilized by the crop.
* **Sustainable Soil Health:** The organic components of INM improve soil structure, microbial diversity, and long-term fertility.
* **Environmental Sustainability:** Minimizing nutrient runoff and leaching mitigates the environmental impact of excessive fertilizer application.
* **Resilience to Climate Variability:** A balanced nutrient supply enhances the crop's ability to withstand changing environmental conditions.
* **Nitrogen and Sulphur Supplementation:** The integrated application of mineral fertilizers and organic materials is an effective strategy for sustainable crop production.
* **Combined Use of Organic Amendments:** Using amendments like vermicompost and farmyard manure significantly enhances nutrient content and uptake.
* **Controlled-Release Fertilizers:** These fertilizers release nutrients gradually, matching the crop's uptake patterns and minimizing losses.
* **Foliar Fertilization:** Applying nutrients directly to the leaves is effective for correcting micronutrient deficiencies.
* **Nutrient-Efficient Crop Varieties:** Breeding and genetic engineering can develop tomato varieties with enhanced nutrient uptake and utilization efficiency.
* **Genome Editing (CRISPR/Cas9):** This technology allows for precise modifications of genes associated with nutrient efficiency, leading to improved nutrient acquisition.
* **Precision Agriculture:** Using technologies like remote sensing and GIS to optimize nutrient management based on real-time data of crop health and soil variability.
* **Variable Rate Technology (VRT):** This component of precision agriculture allows for the precise application of fertilizers based on soil and crop needs.
* **Nanotechnology:** Nano-fertilizers offer controlled and targeted nutrient delivery, enhancing nutrient solubility and availability.
* **Soil Health Management:** Practices that enhance soil organic matter, such as cover cropping and crop rotation, improve nutrient availability and water holding capacity.
* **Biotechnology for Nutrient Uptake:** Modifying root architecture and using transgenic approaches can enhance nutrient acquisition and utilization.

View file

@ -0,0 +1,31 @@
### Basil (*Ocimum basilicum*)
1. **Basil Downy Mildew** (*Peronospora belbahrii*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** The most effective strategy is managing moisture and air. Plant in full sun with wide spacing to promote airflow. Use drip irrigation to avoid wet leaves. For indoor or greenhouse growing, reduce humidity (below 85%) and use fans to circulate air. If possible, grow resistant varieties (e.g., 'Prospera', 'Amazel'). Monitor plants closely, especially the undersides of leaves, and remove infected plants immediately.
* **Biological:** Research into biological controls is ongoing. Some biofungicides containing *Bacillus amyloliquefaciens* may provide some preventative suppression.
* **Chemical:** Fungicides are most effective when applied preventively. Organic options are limited; some potassium bicarbonate or phosphorous acid-based products have shown some efficacy. Conventional fungicides specifically targeting oomycetes are more effective, with active ingredients like mandipropamid or cyazofamid. Check local regulations, as product availability for herbs is often limited.
2. **Fusarium Wilt** (*Fusarium oxysporum* f. sp. *basilici*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Plant Fusarium-resistant cultivars ('Nufar', 'Genovese Compact', 'Elidia'). Use certified disease-free seed, as the pathogen can be seed-borne. If the disease has been present, do not plant basil in the same soil for at least 3-4 years. Sanitize all tools, pots, and equipment.
* **Biological:** Biofungicides containing *Trichoderma* or *Streptomyces* strains can be incorporated into the soil or potting mix to help suppress the pathogen.
* **Chemical:** Fungicides are not effective once the plant is infected. Prevention through resistance and sanitation is key.
3. **Gray Mold** (*Botrytis cinerea*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Focus on sanitation and air circulation. Remove and destroy any dead or dying leaves and stems promptly. Thin plants to improve airflow. Water in the morning at the base of the plant. In greenhouses, reduce humidity and use fans.
* **Biological:** Biofungicides based on *Bacillus subtilis* or *Streptomyces lydicus* can be used preventively.
* **Chemical:** Fungicides for *Botrytis* are available but check labels for use on culinary herbs. Active ingredients can include fenhexamid or boscalid. Potassium bicarbonate is an OMRI-listed option that can help manage mild infections.
4. **Bacterial Leaf Spot** (*Pseudomonas cichorii*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** The key is to keep leaves dry. Avoid overhead watering and splashing. Provide good spacing for air circulation. Remove infected leaves or entire plants to reduce inoculum.
* **Biological:** None are considered highly effective for active control.
* **Chemical:** Copper-based bactericides can be used preventively but have limited effectiveness once the disease is established and can cause phytotoxicity on young basil.
5. **Damping-Off** (*Rhizoctonia*, *Pythium*, *Fusarium* spp.)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Use sterile potting mix and clean containers. Do not overwater seedlings and ensure good drainage. Provide adequate light and air circulation. Sow seeds thinly to avoid overcrowding.
* **Biological:** Incorporating a biofungicide containing *Trichoderma harzianum* or *Streptomyces* into the seeding mix can help protect seedlings from infection.
* **Chemical:** Fungicide-treated seed is available. A soil drench with a broad-spectrum fungicide labeled for damping-off can be used, but prevention is far more effective.

View file

@ -0,0 +1,31 @@
### Lettuce (*Lactuca sativa*)
1. **Downy Mildew** (*Bremia lactucae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Planting resistant cultivars is the most effective method; however, the pathogen has many races, so resistance can be overcome. Maximize spacing between plants for air circulation. Use drip irrigation. In greenhouses, vent to reduce humidity, especially at night. Remove crop residue and control wild lettuce weeds.
* **Biological:** Limited efficacy, but some *Bacillus* strains may offer preventative suppression.
* **Chemical:** Preventive fungicide programs are key. Organic options include copper-based products. Conventional, oomycete-specific fungicides are highly effective, including products with active ingredients like mandipropamid, cyazofamid, and phosphorous acid. Rotating chemistries is vital.
2. **Sclerotinia Drop** (*Sclerotinia sclerotiorum* & *S. minor*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This is a soil-borne disease. A long crop rotation (4+ years) with non-host crops (like corn or onions) is important. Improve soil drainage and avoid excessive irrigation. Deep plowing can bury the sclerotia. Some cultivars show partial resistance or have an upright architecture that reduces leaf-soil contact.
* **Biological:** The fungus *Coniothyrium minitans* is a parasite of *Sclerotinia* sclerotia and is available as a commercial biofungicide (e.g., Contans®) that is applied to the soil to reduce inoculum over time.
* **Chemical:** Soil-applied fungicides at the time of planting or thinning can be effective. Active ingredients include iprodione, boscalid, and fluazinam.
3. **Bottom Rot** (*Rhizoctonia solani*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Manage soil moisture to avoid prolonged wetness. Crop rotation with non-susceptible crops is beneficial. Plant on raised beds to promote drainage and reduce soil contact with lower leaves. Some cultivars are less susceptible than others.
* **Biological:** Soil applications of *Trichoderma* or *Bacillus*-based biofungicides may help suppress the pathogen.
* **Chemical:** Fungicides applied as a directed spray to the base of the plant and soil surface are most effective. Active ingredients include iprodione, azoxystrobin, and fluazinam.
4. **Powdery Mildew** (*Erysiphe cichoracearum*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Plant resistant varieties if available. Provide good air circulation through proper spacing. Manage weeds.
* **Biological:** *Bacillus subtilis*-based products can be effective as preventatives.
* **Chemical:** Organic options include sulfur, horticultural oils, neem oil, and potassium bicarbonate. Conventional systemic fungicides (e.g., myclobutanil) are also very effective.
5. **Bacterial Leaf Spot** (*Xanthomonas campestris* pv. *vitians*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Use certified disease-free seed. Practice a 3-year rotation away from lettuce. Avoid overhead irrigation to prevent bacterial splash. Control weeds in and around the field. Remove crop debris promptly after harvest.
* **Biological:** No effective biological controls are commercially available.
* **Chemical:** Copper-based bactericides are the primary chemical control. They provide protective, not curative, action and must be applied before symptoms are widespread. Resistance to copper is a concern.

View file

@ -0,0 +1,31 @@
### Mint (*Mentha* species)
1. **Mint Rust** (*Puccinia menthae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This fungus has a complex life cycle. The most important step is to remove and destroy all above-ground plant material in the fall to eliminate overwintering spores. In spring, inspect the first shoots for systemic infection (pale and distorted) and remove them immediately. Promote good air circulation and avoid overhead watering.
* **Biological:** There are no widely established biological controls for mint rust.
* **Chemical:** Fungicides should be applied at the first sign of disease. Organic options include sulfur-based or neem oil fungicides. Conventional fungicides with active ingredients like myclobutanil or propiconazole are effective but check labels carefully for use on edible mint.
2. **Powdery Mildew** (*Erysiphe cichoracearum*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Plant in a sunny location with good air movement. Prune and thin dense stands to increase circulation. Avoid excessive nitrogen fertilizer, which encourages lush, susceptible growth.
* **Biological:** Commercially available products containing the bacterium *Bacillus subtilis* can work as a preventative.
* **Chemical:** Several products are effective. Organic options include potassium bicarbonate, neem oil, or horticultural oils. Conventional systemic fungicides like myclobutanil are also effective.
3. **Verticillium Wilt** (*Verticillium dahliae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** There is no cure. The primary strategy is avoidance. Use certified disease-free planting stock (rhizomes). Do not plant mint in areas where other susceptible crops (e.g., potatoes, tomatoes, strawberries) have recently grown. Practice long rotations (5+ years) out of susceptible crops. Solarization can help reduce inoculum in heavily infested soil.
* **Biological:** No effective biological controls are available for established infections.
* **Chemical:** No fungicides are effective against an active infection. Pre-plant soil fumigation is the only chemical option and is used in commercial production.
4. **Anthracnose** (*Sphaceloma menthae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Use disease-free planting material. Remove infected debris. Improve air circulation and avoid overhead watering to reduce leaf wetness periods.
* **Biological:** Limited options available.
* **Chemical:** Protective fungicide sprays can be used. Copper-based products are an organic option. Conventional fungicides like chlorothalonil (check label for use on mint) may be effective.
5. **Stem and Stolon Rot** (*Rhizoctonia solani*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Improve soil drainage. Avoid overwatering and dense planting. Rotate crops with non-susceptible plants like corn or small grains.
* **Biological:** Biofungicides containing strains of *Trichoderma* can be incorporated into the soil to help suppress *Rhizoctonia*.
* **Chemical:** Soil-applied fungicides with active ingredients like azoxystrobin may provide some control, but improving cultural conditions is more sustainable.

View file

@ -0,0 +1,21 @@
### Rosemary (*Rosmarinus officinalis*)
1. **Powdery Mildew** (*Erysiphe* spp.)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This is the most important factor. Ensure excellent air circulation by pruning dense growth and providing adequate spacing. Plant in a sunny location. Avoid over-fertilizing.
* **Biological:** Some strains of *Bacillus subtilis* have shown efficacy.
* **Chemical:** For edible rosemary, use OMRI-listed products like horticultural oil, neem oil, or potassium bicarbonate. Apply thoroughly, covering all plant surfaces. For ornamental use, systemic fungicides like myclobutanil can be used.
2. **Root Rot** (*Phytophthora* & *Pythium* spp.)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This is almost entirely a cultural problem. Plant in very well-drained soil, such as a sandy loam or a pot with large drainage holes. Amend heavy soils with compost and grit. Water deeply but infrequently, allowing the soil to dry out significantly between waterings. Rosemary is highly drought-tolerant.
* **Biological:** Incorporating beneficial microbes like *Trichoderma* into the potting mix can help suppress root rot pathogens.
* **Chemical:** Fungicide drenches are available but will not save a plant with advanced rot. They are best used preventively in nursery settings. Active ingredients include mefenoxam (*Pythium*) and phosphorous acid (*Phytophthora*).
3. **Botrytis Blight** (*Botrytis cinerea*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Prune to open up the plant canopy and improve air circulation. Water at the base of the plant in the morning. Remove any dead or decaying plant material immediately.
* **Biological:** *Bacillus subtilis*-based products can be used preventively.
* **Chemical:** Check labels carefully for use on herbs. Potassium bicarbonate is an organic option.
(The final two diseases, **Aerial Blight** and **Bacterial Leaf Spot**, are less common and are managed with the same principles: improve air circulation and avoid wet foliage.)

View file

@ -0,0 +1,31 @@
### Strawberry (*Fragaria × ananassa*)
1. **Gray Mold** (*Botrytis cinerea*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This is key. Promote good air circulation through proper plant spacing and by managing runner growth. Use straw mulch to keep fruit from touching the soil. Water in the morning via drip irrigation. Harvest fruit frequently and remove any mummified or rotting berries from the field immediately.
* **Biological:** Several biofungicides are effective, containing strains of *Bacillus subtilis*, *Bacillus amyloliquefaciens*, or *Streptomyces lydicus*. These should be applied preventively, starting at early bloom.
* **Chemical:** Fungicide applications should be timed to protect the flowers, as infection often begins there. Rotate different chemical classes (FRAC groups) to prevent resistance. Effective active ingredients include fenhexamid, boscalid + pyraclostrobin, and cyprodinil + fludioxonil.
2. **Powdery Mildew** (*Podosphaera aphanis*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Plant resistant or tolerant cultivars. Provide good air circulation. In tunnels or greenhouses, manage humidity.
* **Biological:** Microbial biofungicides (*Bacillus* spp.) can provide good preventative control.
* **Chemical:** Sulfur is a common and effective organic option but can be phytotoxic in high heat. Horticultural oils and potassium bicarbonate are also effective. Conventional systemic fungicides (e.g., quinoxyfen, myclobutanil) provide excellent control.
3. **Anthracnose Fruit Rot & Crown Rot** (*Colletotrichum* spp.)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Start with certified disease-free transplants. Use resistant cultivars where available. Use straw mulch to reduce spore splashing from soil to fruit. Avoid overhead irrigation. Remove infected plants and fruit immediately.
* **Biological:** Biofungicides have shown some suppressive activity but are generally not sufficient for control in high-pressure situations.
* **Chemical:** A preventative fungicide program is essential in regions where this disease is common. Strobilurin fungicides (e.g., azoxystrobin, pyraclostrobin) and captan are commonly used. Rotation is critical as resistance to strobilurins is widespread.
4. **Common Leaf Spot** (*Mycosphaerella fragariae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Plant resistant varieties. Remove old, infected leaves after renovation (in matted-row systems) or during the season. Promote air circulation and use drip irrigation.
* **Biological:** Limited options.
* **Chemical:** Fungicide sprays are effective. Organic options include copper-based products. Conventional options used for other diseases (e.g., captan, strobilurins) will also control leaf spot.
5. **Verticillium Wilt** (*Verticillium dahliae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** The most important strategy. Use certified disease-free, resistant cultivars. Do not plant strawberries in soil where susceptible crops (potatoes, tomatoes, raspberries, mint) have been grown for the past 5 years.
* **Biological:** Pre-plant soil treatment with biofumigant cover crops (e.g., specific mustard varieties) or soil solarization can reduce soil inoculum.
* **Chemical:** No post-planting fungicides are effective. Pre-plant soil fumigation is the only chemical option and is used in commercial production where disease pressure is high.

View file

@ -0,0 +1,31 @@
### Tomato (*Solanum lycopersicum*)
1. **Early Blight** (*Alternaria solani*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** The first line of defense is crucial. Use certified disease-free seeds and resistant cultivars (e.g., 'Mountain Fresh Plus', 'Celebrity'). Practice a crop rotation of at least 3 years, avoiding other susceptible crops like potatoes and eggplants. Ensure proper plant spacing to promote air circulation and stake or cage plants to keep foliage off the ground. Mulch the soil to create a barrier that prevents fungal spores from splashing onto lower leaves. Avoid overhead irrigation; use drip irrigation or soaker hoses to keep foliage dry. Remove and destroy infected lower leaves as they appear and clear all plant debris from the garden at the end of the season.
* **Biological:** Biofungicides containing *Bacillus subtilis* (strain QST 713) or *Bacillus amyloliquefaciens* can be used preventively to colonize the leaf surface and inhibit fungal spore germination.
* **Chemical:** Apply fungicides preventively when conditions are favorable for disease. For organic growers, copper-based fungicides (e.g., copper hydroxide) are effective but must be used judiciously to avoid soil accumulation. Conventional options include protectant fungicides with active ingredients like chlorothalonil or mancozeb.
2. **Late Blight** (*Phytophthora infestans*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** This is the most critical disease to prevent. Plant late blight-resistant varieties ('Mountain Magic', 'Iron Lady', 'Defiant PhR'). Do not save seed potatoes, as the pathogen can overwinter in them. Maintain a rigorous 3-4 year crop rotation, separating tomatoes and potatoes as far as possible. Ensure excellent air circulation through spacing and pruning. Water only at the base of the plant. Monitor disease forecasting networks (e.g., USAblight.org) to know when conditions are high-risk. Immediately destroy any infected plants by bagging and removing them from the site (do not compost).
* **Biological:** Biofungicides containing various strains of *Bacillus* species can offer some suppression when applied preventively but are generally not effective once an outbreak begins.
* **Chemical:** Preventive fungicide applications are essential in high-risk conditions. Copper-based products are the primary organic option. For conventional growers, a preventative program using chlorothalonil or mancozeb is common. If the disease is present, more targeted oomycete-specific fungicides with active ingredients like cyazofamid, mandipropamid, or mefenoxam may be needed. Rotation of chemical classes is critical to prevent resistance.
3. **Fusarium Wilt** (*Fusarium oxysporum* f. sp. *lycopersici*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** The best method is to use resistant varieties, indicated by an "F" in the cultivar name (e.g., 'Better Boy VFN'). There are three known races of the fungus, so look for varieties with F1, F2, and F3 resistance. Since the pathogen is soil-borne and very persistent, a long crop rotation (5-7 years) is recommended. Raise the soil pH to between 6.5 and 7.0, as the fungus is less active in neutral to slightly alkaline soils. Improve soil drainage and avoid over-fertilizing with nitrogen.
* **Biological:** Soil amendments with compost can introduce beneficial microorganisms that compete with *Fusarium*. Some commercial biofungicides containing strains of the fungus *Trichoderma harzianum* or bacteria *Streptomyces lydicus* have shown suppressive effects on soil-borne pathogens.
* **Chemical:** There are no effective chemical fungicides for treating an already infected plant, as the fungus resides within the plant's vascular system. Soil fumigation can be used in commercial fields before planting but is not practical for most gardeners. Prevention is the only effective strategy.
4. **Verticillium Wilt** (*Verticillium dahliae*)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** As with Fusarium wilt, the primary control is planting resistant varieties, designated with a "V" (e.g., 'Celebrity VFN'). The pathogen has a very wide host range and can survive in the soil for many years as microsclerotia, making crop rotation less effective but still beneficial. Good sanitation and removing crop debris are important. Avoid excessive nitrogen fertilization.
* **Biological:** Soil solarization (covering moist soil with clear plastic during the hottest months) can reduce the population of microsclerotia in the upper soil layers in hot climates. Biofumigation with mustard cover crops has also shown some efficacy in reducing pathogen inoculum.
* **Chemical:** Similar to Fusarium wilt, fungicides are not effective for curing infected plants. Pre-plant soil fumigation is the main chemical tool used in large-scale agriculture.
5. **Bacterial Spot** (*Xanthomonas* species)
* **Integrated Management Strategies:**
* **Cultural & Preventive:** Start with certified disease-free seed and transplants. Practice a 3-year crop rotation, avoiding peppers. Use mulch to prevent bacteria from splashing from the soil onto plants. Avoid working among plants when they are wet. Promote rapid drying of foliage through proper spacing and morning watering at the soil level.
* **Biological:** Some studies suggest certain bacteriophage therapies can reduce bacterial populations, but this is not yet a mainstream control method.
* **Chemical:** Control is difficult once established. Preventive sprays are most effective. Copper-based bactericides (e.g., copper hydroxide) are the standard treatment, often mixed with mancozeb to improve efficacy and reduce the risk of bacterial resistance. Products containing the antibiotic streptomycin may be used in some areas, but resistance is a major concern.

View file

@ -0,0 +1,21 @@
Basil's growth, yield, and chemical composition are significantly influenced by environmental and nutritional stress.
* **Water Stress (Drought):** Inhibits overall plant growth and significantly reduces dry herb yield.
* **Drought Effects:** Leads to a decrease in total sugar and carotenoid concentrations.
* **Biomass:** Drought stress reduces dry herb yield, which can be attributed to a smaller leaf area index and reduced photosynthesis.
* **Photosynthesis:** Drought stress leads to a significant decrease in the net assimilation rate and stomatal conductance.
* **Essential Oils:** Water stress can have a positive or negative effect on essential oil content, depending on the cultivar and stress severity.
* **Heat Stress:** High temperatures inhibit plant growth and significantly decrease total chlorophyll levels.
* **Oxidative Stress:** Both high temperature and water stress can cause oxidative stress, indicated by increased malondialdehyde (MDA) levels.
* **Phenolic Compounds:** The concentration of total phenolic compounds increases in response to water and heat stress.
* **Flavonoids:** Flavonoid content increases under high-temperature stress but may decrease under water stress.
* **Proline and Glycine Betaine:** Under severe stress, basil plants accumulate proline and glycine betaine, which aid in cellular osmoregulation.
* **Salt Stress:** Basil is considered moderately tolerant to salinity.
* **Salinity Effects:** High salt levels can cause stunted growth, leaf yellowing, and reduced essential oil yield.
* **Genotype Variation:** The response to salt stress is genotype-dependent; some cultivars may see a reduction in fresh yield while others are unaffected.
* **Carotenoids under Salinity:** Salt stress can either increase or decrease lutein and β-carotene concentrations depending on the cultivar.
* **Volatile Organic Compounds (VOCs):** The composition of VOCs, which contribute to the aroma, is significantly affected by salinity, with compounds like linalool being negatively impacted.
* **Nutritional Stress:** Nitrogen content in the plant can be increased by salt stress in some cultivars.
* **Flooding Stress:** Reduces photosynthetic rates and stomatal conductance.
* **Combined Flooding and Drought:** This sequence of stress has a more significant negative impact on photosynthetic pigments and flavonoid content than single stress events.
* **Pigment Reduction:** Chlorophyll a, chlorophyll b, and β-carotene levels all decrease under combined flooding and drought stress.

View file

@ -0,0 +1,21 @@
As a leafy vegetable, lettuce is particularly vulnerable to stresses that affect turgor, growth, and nutrient uptake.
* **Water Stress (Drought):** Negatively affects growth and productivity, with low irrigation levels significantly reducing yield.
* **Drought Effects on Biomass:** Drought leads to lower dry aerial weight and dry root weight.
* **Yield Reduction:** Drought stress can decrease lettuce yield by up to 50%.
* **Nutrient Stress:** Nutrient unbalance or deficiency, particularly of nitrogen and phosphorus, can negatively affect crop productivity.
* **Combined Water and Nutrient Stress:** When combined, these stresses have a more significant negative impact than when applied individually.
* **Cold Stress:** Cold soil temperatures and frosts can cause cellular damage and increase disease pressure.
* **Waterlogging:** Can lead to anoxic conditions in the root zone, stressing the plant.
* **Light Stress:** Lettuce is sensitive to continuous light, especially at high intensities, which can induce oxidative stress.
* **Biotic Stress (Fungal):** Fungal diseases like Fusarium wilt can have a greater negative effect on lettuce than water or nutritional stress, reducing fresh weight by up to 69%.
* **Phenolic Compounds:** Stressed lettuce plants show a higher phenolic index, indicating an induced defense response.
* **Anthocyanins:** Biotic stress can lead to a significant increase in anthocyanin content.
* **Nitrate Levels:** Drought stress has been reported to decrease fresh biomass-related nitrate levels.
* **Calcium Deficiency:** Both overly humid and overly dry conditions can interrupt transpiration, leading to calcium deficiency, which manifests as tip burn or internal browning.
* **Silicon Application:** Foliar applications of silicon can strengthen plant cells, protecting the crop from cold stress, wind damage, and high humidity.
* **Antioxidant Response:** Lettuce plants have an antioxidant defense system to overcome oxidative stress from factors like continuous light.
* **Root-to-Shoot Ratio:** Under continuous light, lettuce plants may show a greater root-to-shoot ratio as an adaptive response.
* **Chlorophyll Fluorescence:** This parameter can be used to monitor the plant's response to light stress.
* **Spectral Indices:** Indices like the Pigment Specific Simple Ratio (PSSRa) can effectively detect biotic stress before visual symptoms appear.
* **Combined Abiotic and Biotic Stress:** The combination of stresses can lead to unique responses; for example, lettuce subjected to both water and biotic stress showed the highest phenolic index.

View file

@ -0,0 +1,21 @@
Mint species are economically important for their essential oils, and their growth and chemical profiles are sensitive to various stressors.
* **Abiotic Stress Factors:** Mint is affected by a wide range of abiotic stresses including salinity, drought, heat, and heavy metals.
* **General Effects:** These stressors alter the plant's morphology, physiology, and biochemical processes, leading to dysfunction in growth, photosynthesis, and respiration.
* **Drought Stress:** Decreases fresh and dry weight, leaf number, plant height, and root dry weight.
* **Drought and Essential Oils:** While biomass may decrease, drought stress can sometimes increase the concentration of essential oils and enhance their antioxidant activity.
* **Drought and Photosynthesis:** Water stress negatively impacts photosynthetic activity.
* **Salt Stress:** High salinity levels adversely affect plant growth, oil yield, and physiological parameters.
* **Salinity and Biomass:** Increasing NaCl concentrations significantly reduces fresh and dry biomass production.
* **Salinity and Essential Oils:** Moderate salinity may increase essential oil content, but higher levels cause a decrease. Salinity also alters the chemical composition of the oil, decreasing menthol while increasing menthone and menthofuran.
* **Proline Accumulation:** The amino acid proline increases in tissues under environmental stress, indicating an adaptive response.
* **Chlorophyll Content:** Drought stress can cause a reduction in chlorophyll content.
* **Phenolic and Flavonoid Content:** Drought stress has been shown to increase total phenolic and flavonoid content.
* **Oxidative Stress:** Drought can lead to an increase in hydrogen peroxide and malondialdehyde (MDA) content, indicating oxidative stress.
* **Species Sensitivity:** Among different mint species, *Mentha arvensis* is particularly susceptible to loss of oil percentage under salinity stress.
* **Heat Stress:** Reduces the content of essential oils.
* **Combined Stresses:** The response of mint to combined stresses can differ significantly from its response to a single stress factor.
* **Phytohormones:** The application of various phytohormones can help alleviate the negative impacts of environmental stress.
* **Bio-stimulants:** The use of commercial bio-stimulants can improve morphological performance and ameliorate the effects of water stress.
* **Root Formation:** Salinity stress can inhibit adventitious root formation, which is important for vegetative propagation.
* **Secondary Metabolites:** The production of secondary metabolites is a defense mechanism for survival and adaptation to stress conditions.

View file

@ -0,0 +1,21 @@
Rosemary is a hardy Mediterranean plant known for its essential oils, but its growth and chemical profile can still be affected by severe environmental stress.
* **Drought Stress:** Controlled drought stress can have a minimal impact on overall growth but alters the essential oil composition.
* **Biomass under Drought:** Severe drought can lead to a decrease in the development of fresh biomass.
* **Essential Oils under Drought:** Drought stress generally leads to an increase in the production of essential oils as a defense mechanism.
* **Terpene Composition:** Drought can increase the percentage of terpenes like bornyl-acetate and β-caryophyllene, while decreasing α-pinene.
* **Salt Stress:** Salinity is a major environmental stress that limits the growth and productivity of rosemary.
* **Salinity and Vegetative Growth:** Increasing soil salinity levels discernibly reduces plant height and total herb dry weight.
* **Salt Resistance Index (SRI):** The SRI decreases with increasing salinity.
* **Chlorophyll:** Total chlorophyll in leaves is reduced by higher soil salinity.
* **Proline Content:** Salinity enhances leaf proline content as an osmoprotectant.
* **Volatile Oil Percentage:** Irrigation with saline water can have a significant effect on the volatile oil percentage.
* **Volatile Oil Composition:** Salinity alters the chemical makeup of the essential oil; for example, the major constituent camphor can be affected.
* **Amino Acid Application:** Applying amino acids like L-tryptophan and glutamine can improve plant growth, chlorophyll content, and salt resistance under salinity stress.
* **Antistress Agents:** The application of agents like salicylic acid and diatomaceous earth can improve vegetative growth and volatile oil percentage in plants under salt stress.
* **Combined Salinity and Amino Acids:** The combination of amino acid application with low-to-moderate soil salinity can enhance the Salt Resistance Index to over 100%.
* **Water Stress from Irrigation Type:** The type of irrigation water (tap water vs. saline water) and rainfed conditions (non-irrigated) create different stress levels, affecting essential oil yield and composition.
* **Essential Oil Yield:** Rainfed (non-irrigated) conditions can result in the highest essential oil yield, while irrigation with saline water results in the lowest.
* **Anti-stress Effects (Internal):** Rosemary leaf extract has been shown to have anti-stress effects in animal studies, alleviating stress-induced dysfunctions, which points to the plant's complex chemical response to its environment.
* **Location and Cultivar Influence:** The effects of drought stress on biomass and essential oil yield are significantly influenced by the growing location and the specific rosemary cultivar.
* **Suitability for Marginal Land:** Its general tolerance suggests rosemary is suitable for cultivation in marginal soils to protect against erosion and diversify crops.

View file

@ -0,0 +1,22 @@
Strawberry plants, with their shallow root systems, are particularly sensitive to environmental stresses, especially those related to water and temperature.
* **Nitrogen Stress:** Nitrogen deficiency affects the plant's photosynthetic pathways. A smartphone-based index measuring the ratio of blue light reflectance can detect nitrogen stress. The index value decreases with increasing nitrogen stress exposure.
* **Drought Stress:** As a plant with a shallow root system and large leaf area, it is highly sensitive to water deficiency.
* **Drought Effects on Growth:** Drought reduces leaf area, shoot length, fruit number, and fruit size, ultimately decreasing yield.
* **Root System Response:** Drought stress can stimulate root length, leading to a higher root-to-shoot ratio for greater water uptake.
* **Physiological Responses to Drought:** Plants adapt by adjusting osmotic potential and activating ROS scavenging mechanisms. The relative water content (RWC) of leaves decreases under drought.
* **Photosynthesis and Pigments:** Drought leads to a decrease in photosynthetic pigments and reduced net photosynthesis due to stomatal closure.
* **Salt Stress:** Strawberry is one of the most salt-sensitive horticultural crops.
* **Salinity Effects:** Salinity reduces water and nutrient uptake, decreases root and leaf development, and accelerates leaf senescence, leading to lower yield and quality.
* **Heat Stress:** High temperatures (above 30°C or 86°F) are detrimental, reducing yields, fruit size, total leaf area, and overall plant health.
* **Heat and Fruit Quality:** High temperatures can negatively affect fruit coloration and reduce fruit size and weight.
* **Chilling and Freezing Stress:** These low-temperature stresses can cause significant damage.
* **Cold Stress Responses:** Plants respond to cold by altering chlorophyll concentration, hydrogen peroxide levels, and enzymatic antioxidant mechanisms.
* **Alleviating Cold Stress:** External application of factors like salicylic acid can protect plants by increasing chlorophyll and soluble sugar concentrations.
* **Biotic Stress:** The angular leaf spot (ALS) disease is a major biotic stressor for strawberry production.
* **PGP Microorganisms:** Inoculating plants with Plant-Growth-Promoting (PGP) bacteria can significantly increase plant growth and fruit production, even under salinity or disease stress.
* **Cultivar Variability:** Tolerance to drought, heat, and salinity varies significantly among different strawberry cultivars.
* **Leaf Temperature:** Leaf temperature increases under water stress conditions due to reduced transpiration.
* **Quantum Yield:** This measure of photosynthetic efficiency is affected by water stress.
* **Water Use Efficiency (WUE):** WUE is a key parameter affected by drought conditions.
* **Growing Environment:** Strawberries grown in greenhouses or soilless cultivation systems are more sensitive to water stress than those grown in open fields.

View file

@ -0,0 +1,22 @@
Tomatoes are sensitive to a range of environmental stressors that can impact their growth, yield, and quality.
* **Nutritional Stress:** Nitrogen deficiency, often combined with drought, can negatively affect the biological traits of pests like *Tuta absoluta* but is also unfavorable to the tomato plants themselves.
* **Nitrate Overload:** Excessive use of nitrate-based fertilizers can cause oxidative stress, leading to stunted growth and cellular damage.
* **Salt Stress:** Considered moderately salt-sensitive, with a saturated soil paste extract electrical conductivity (ECe) threshold value of 1.5 dS m1.
* **High Salinity:** Leads to a decrease in the green parts of the plant and reduces the mineral nutrient content of potassium and calcium in the leaves.
* **Sodium and Chloride Content:** Salt stress can cause an increase in sodium (Na+) and chloride (Cl-) content, which can be toxic to the plant.
* **Grafting:** Grafting tomato plants can enhance resistance to thermal stress.
* **Drought Stress:** Reduces leaf water content, photosynthesis rates, and stomatal conductance, negatively impacting leaf growth.
* **Combined Drought and Nutrient Stress:** This combination can lead to a significant reduction in leaf fresh weight, dry weight, and overall water content.
* **Water Stress (General):** Affects the growth and development of tomato plants negatively.
* **Leaf Area:** Plants under drought, salt, and water stress tend to have a smaller leaf area compared to control plants.
* **Chlorophyll Content:** Can be higher in plants under drought, salt, and excessive water stress compared to plants not exposed to drought.
* **Potassium Levels:** Salt stress can lead to higher potassium levels in the green parts of the plant compared to control plants.
* **Calcium Levels:** Salt accumulation can cause an increase in calcium in the root region.
* **Magnesium Levels:** The effect of moderate water reduction on magnesium (Mg2+) levels in leaves can vary depending on the cultivar.
* **Heat Stress:** High temperatures negatively impact both vegetative growth and reproductive processes, leading to significant losses in yield and fruit quality.
* **Reproductive Stage:** Heat stress during the reproductive stage is particularly damaging as it affects flower number, stigma exertion, pollen germination, and fruit set.
* **Waterlogging:** Can reduce plant growth, degrade chlorophyll, and increase oxidative stress markers like malondialdehyde and hydrogen peroxide, which damages membrane integrity.
* **Phenolic Compounds:** The concentration of phenolic compounds in leaves and fruits is a sensitive indicator of waterlogging stress.
* **Wild vs. Cultivated Species:** Wild tomato species may exhibit different and sometimes more robust responses to stresses like varied temperatures and nitrogen deficiency compared to cultivated varieties.
* **Combined Stresses:** The combination of abiotic (like drought and nutrient deficiency) and biotic (like herbivory) stresses can result in a "new stress state" with non-additive effects, which can be more harmful than single stressors.

BIN
backend/strawberry.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

7
backend/test.http Executable file
View file

@ -0,0 +1,7 @@
### POST request to parse-plant endpoint
POST http://localhost:3000/parse-plant
Content-Type: application/json
{
"description": "i see a tomato with fruits and no flowers"
}

318
backend/testcases.md Executable file
View file

@ -0,0 +1,318 @@
===
A healthy strawberry plant with green leaves, several small, hard, green unripe berries, and white blossoms.
strawberry berries flowers.jpg
Moved to a location with full sun for 8+ hours a day. Provided a fertilizer rich in Potassium (K) and Phosphorus (P). Watered consistently to keep soil moist.
For 1 week
{
"plant_state_description": "A healthy strawberry plant with green leaves, small unripe green berries, and white blossoms.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Strawberry",
"height": 15,
"leaf_color": "Vibrant green",
"presence_of_flowers": true,
"fruit_development": true,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Healthy",
"growth_rate": "Normal",
"photosynthesis_rate": "Normal",
"transpiration_rate": "Normal"
}
}
},
"environmental_changes_description": "Moved to full sun, received K/P fertilizer, watered consistently.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 22,
"relative_humidity": 60,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 1
},
"soil": {
"soil_temperature": 20,
"soil_acidity": 6.0,
"soil_moisture": 70,
"nutrients": ["Potassium (K)", "Phosphorus (P)", "Nitrogen (N)"]
},
"light": {
"light_intensity": 1000,
"photoperiod": 8
},
"water": {
"watering_frequency": 5
}
}
},
"time_period": "1 week"
}
===
A healthy strawberry plant with green leaves, several small, hard, green unripe berries, and white blossoms.
strawberry berries flowers.jpg
Completely stopped watering. Air temperature is consistently high, around 35°C.
for 1 week.
{
"plant_state_description": "A healthy strawberry plant with green leaves and some small green berries.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Strawberry",
"height": 15,
"leaf_color": "Vibrant green",
"presence_of_flowers": true,
"fruit_development": true,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Healthy",
"growth_rate": "Normal",
"photosynthesis_rate": "Normal",
"transpiration_rate": "Normal"
}
}
},
"environmental_changes_description": "Stopped watering, high air temperature.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 35,
"relative_humidity": 40,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 2
},
"soil": {
"soil_temperature": 28,
"soil_acidity": 6.0,
"soil_moisture": 10,
"nutrients": [""]
},
"light": {
"light_intensity": 800,
"photoperiod": 10
},
"water": {
"watering_frequency": 0
}
}
},
"time_period": "1 week"
}
===
A vibrant, bushy basil plant with dark green leaves.
basil healthy.jpg
Placed in complete darkness. Watered normally.
for 1 week.
{
"plant_state_description": "A vibrant, bushy basil plant with dark green leaves.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Basil",
"height": 25,
"leaf_color": "Dark green",
"presence_of_flowers": false,
"fruit_development": false,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Healthy",
"growth_rate": "Normal",
"photosynthesis_rate": "Normal",
"transpiration_rate": "Normal"
}
}
},
"environmental_changes_description": "Placed in complete darkness, watered normally.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 22,
"relative_humidity": 60,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 0
},
"soil": {
"soil_temperature": 20,
"soil_acidity": 6.5,
"soil_moisture": 70,
"nutrients": [""]
},
"light": {
"light_intensity": 0,
"photoperiod": 0
},
"water": {
"watering_frequency": 7
}
}
},
"time_period": "1 week"
}
===
A healthy tomato plant with green leaves and developing small green fruit.
healthy tomato.jpg
No watering provided. Warm, average daytime temperature of 25°C.
for 3 days
{
"plant_state_description": "A healthy tomato plant with green leaves and developing small green fruit.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Tomato",
"height": 50,
"leaf_color": "Green",
"presence_of_flowers": false,
"fruit_development": true,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Healthy",
"growth_rate": "Normal",
"photosynthesis_rate": "Normal",
"transpiration_rate": "Normal"
}
}
},
"environmental_changes_description": "No watering provided, warm daytime temperature.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 25,
"relative_humidity": 55,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 1
},
"soil": {
"soil_temperature": 23,
"soil_acidity": 6.0,
"soil_moisture": 15,
"nutrients": [""]
},
"light": {
"light_intensity": 800,
"photoperiod": 12
},
"water": {
"watering_frequency": 0
}
}
},
"time_period": "3 days"
}
===
A tomato plant with yellowing lower leaves and slight wilting
sick tomato.jpg
Watered consistently. Applied a balanced NPK fertilizer. Moderate sunlight
for 5 days
{
"plant_state_description": "A tomato plant with yellowing lower leaves and slight wilting.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Tomato",
"height": 45,
"leaf_color": "Yellowing lower leaves, green upper leaves",
"presence_of_flowers": false,
"fruit_development": false,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Stressed",
"growth_rate": "Low",
"photosynthesis_rate": "Low",
"transpiration_rate": "Low"
}
}
},
"environmental_changes_description": "Watered consistently, applied NPK fertilizer, moderate sunlight.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 24,
"relative_humidity": 65,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 1
},
"soil": {
"soil_temperature": 22,
"soil_acidity": 6.0,
"soil_moisture": 75,
"nutrients": [""]
},
"light": {
"light_intensity": 600,
"photoperiod": 7
},
"water": {
"watering_frequency": 5
}
}
},
"time_period": "5 days"
}
===
A basil plant showing significant wilting
basil wiltened.jpg
Properly watered, with moist soil. Moved back to a location with good indirect sunlight. Warm, stable temperature
{
"plant_state_description": "A basil plant showing significant wilting, its leaves are limp and pointing downwards.",
"plant_state_details": {
"plant_characteristics": {
"morphological": {
"plant_type": "Basil",
"height": 20,
"leaf_color": "Green, but droopy",
"presence_of_flowers": false,
"fruit_development": false,
"root_health": "Not Visible"
},
"physiological": {
"health_status": "Wilting",
"growth_rate": "Stagnant",
"photosynthesis_rate": "Low",
"transpiration_rate": "Low"
}
}
},
"environmental_changes_description": "Properly watered, moved to indirect sunlight, warm stable temperature.",
"environmental_changes_details": {
"environmental_characteristics": {
"atmosphere": {
"air_temperature": 23,
"relative_humidity": 70,
"co2_concentration": 400,
"air_pressure": 101.3,
"wind_speed": 0
},
"soil": {
"soil_temperature": 21,
"soil_acidity": 6.5,
"soil_moisture": 80,
"nutrients": ["Nitrogen (N)", "Potassium (K)", "Phosphorus (P)"]
},
"light": {
"light_intensity": 300,
"photoperiod": 6
},
"water": {
"watering_frequency": 7
}
}
},
"time_period": "2 days"
}