community_report_prompt.py


Overview

This file defines a comprehensive prompt template named COMMUNITY_REPORT_PROMPT intended for use with AI language models in the context of community information discovery and reporting. The prompt guides an AI assistant to generate detailed, structured, and grounded reports about a community based on given entities, their relationships, and optionally associated claims.

The main purpose of this file is to encapsulate the instructions, expected output format, grounding rules, and example inputs for generating a JSON-formatted narrative report. This report aims to inform human analysts and decision-makers about the makeup, impact, and key insights related to the community's network of entities.


Key Components

Constant: COMMUNITY_REPORT_PROMPT


Detailed Explanation

Purpose

The prompt is designed to be passed into a large language model (LLM) framework that supports prompt engineering. By providing this detailed instruction, the LLM is expected to generate:

This supports analysts who need synthesized, explainable intelligence about complex entity networks.

Usage Example

Suppose a system collects CSV data of entities and relationships within a community (e.g., organizations, events, people). The system would:

  1. Format the CSV data into strings.

  2. Replace {entity_df} and {relation_df} placeholders with these strings.

  3. Append the entire prompt text to the LLM input.

  4. Send the prompt to the LLM for completion.

  5. Parse the LLM output JSON report for presentation or further analysis.


Implementation Details and Algorithms


Interaction with Other System Components


Mermaid Diagram: Flowchart of Main Functional Elements

flowchart TD
    A[Prepare Entity Data CSV] --> B[Insert into COMMUNITY_REPORT_PROMPT]
    C[Prepare Relationship Data CSV] --> B
    B --> D[Send Prompt to LLM]
    D --> E[Receive JSON Report]
    E --> F[Parse JSON Report]
    F --> G[Display / Use Report in Dashboard]
    G --> H[Support Analyst Decision Making]

Summary

The community_report_prompt.py file is a utility resource containing a highly detailed prompt template for generating structured community reports via AI language models. It focuses on:

This file itself contains no executable code or classes but serves as a core prompt resource critical for the information discovery workflow in the system.


End of Documentation for community_report_prompt.py