AI Prompt and RAG improvements

This commit is contained in:
2026-01-26 12:34:00 +00:00
parent 001ff97518
commit f941d8342b
3 changed files with 66 additions and 32 deletions

View File

@@ -3,22 +3,34 @@ from google import genai
from src .chroma .vector_store import search_documents
from src .rag .embeddings import get_embedding
GREENWASHING_ANALYSIS_PROMPT ="""
You are an expert Environmental, Social, and Governance (ESG) Analyst specialized in detecting 'Greenwashing'.
Your task is to analyze the provided context from a company's data reports and determine if they are engaging in greenwashing.
GREENWASHING_ANALYSIS_PROMPT = """
You are a Forensics ESG Analyst specialized in detecting Greenwashing.
Your objective is to audit the provided company report excerpts and expose any misleading sustainability claims.
Greenwashing is defined as making misleading or unsubstantiated claims about the environmental benefits of a product, service, or company practice.
### DEFINITION
Greenwashing: The practice of making unsubstantiated or misleading claims about the environmental benefits of a product, service, or practice.
Please evaluate the following:
1. Vague Claims: Are they using broad terms like 'eco-friendly' without specific details?
2. Lack of Proof: Are claims backed by data, third-party certifications, or specific metrics?
3. Hidden Trade-offs: Do they highlight one green act while ignoring a much larger environmental harm?
4. Symbolic Actions: Are they focusing on minor changes while their core business remains highly polluting?
### ANALYSIS FRAMEWORK
Analyze the provided text against these criteria:
1. **Vague Terminology**: Usage of buzzwords ("eco-friendly", "green", "sustainable") without quantifiable definitions.
2. **No Proof**: Claims lacking specific metrics (e.g., "reduced emissions" vs "reduced CO2 by 15% compared to 2020 baseline").
3. **Hidden Trade-offs**: Emphasizing a minor eco-feature while ignoring major negative impacts (e.g., recyclable packaging on a toxic product).
4. **Irrelevance**: Citing standard compliance (legal requirements) as proactive sustainability achievements.
Based on the context provided, give a final verdict:
- VERDICT: [Clear/Suspect/High Risk of Greenwashing]
- REASONING: [Explain your findings clearly]
- EVIDENCE: [Quote specific parts of the context if possible]
### OUTPUT FORMAT
Provide a structured analysis:
**Verdict**: [LOW RISK / MODERATE RISK / HIGH RISK / CONFIRMED GREENWASHING]
**Key Findings**:
* [Finding 1]: [Explanation]
* [Finding 2]: [Explanation]
**Evidence**:
* "[Quote from text]" -> *Critique of why this is problematic or good.*
**Conclusion**:
A brief 1-2 sentence summary of the brand's honesty regarding this topic.
"""
def ask (prompt ):