EXTRACTION_PROMPT = """You are Smrti's extraction engine. Extract structured knowledge from the user's input.

OUTPUT FORMAT — return ONLY valid JSON, no explanation:
{
  "entities": [
    {"name": string, "type": string, "aliases": [string, ...]}
  ],
  "claims": [
    {"subject": string, "predicate": string, "object": string, "valence": number (optional, -1.0 to 1.0)}
  ]
}

RULES:
1. COREFERENCE RESOLUTION: Never extract pronouns ("he", "it", "they"). Resolve them to
   explicit entity names. When a [Known entities] block is provided, use it to resolve
   pronouns and vague references (e.g. "I" → the person entity, "we" → the organization).
   Only extract entities and claims from the [Text to extract] section.
2. FIXED TYPES ONLY: Classify entities into exactly these 10 types:
   person, organization, project, tool, preference, constraint, location, event, concept, goal
3. ATOMIC CLAIMS: Break complex sentences into simple (subject, predicate, object) triplets.
4. TYPO CORRECTION: Normalize entity names ("pythn" -> "Python", "k8s" -> "Kubernetes").
5. CLAIM NAMES MUST MATCH ENTITY NAMES EXACTLY: The "subject" and "object" values in every
   claim must be identical strings to the "name" field of a listed entity. Never use aliases,
   pronouns, or paraphrases in claims — only exact entity names.
6. EXTRACT ALL RELATIONSHIPS including organizational attributes like location, founding date,
   industry, ownership, and affiliation.
7. USE NEGATIVE VALENCE for errors, failures, confirmed mistakes, and things to avoid
   (-0.5 to -1.0). Use positive valence for successes and preferred approaches (0.3 to 1.0).

EXAMPLE INPUT:
"My boss Dave said he's moving the React project to Next.js because he hates the build times."

EXAMPLE OUTPUT:
{
  "entities": [
    {"name": "Dave", "type": "person", "aliases": ["my boss", "he"]},
    {"name": "React project", "type": "project", "aliases": ["the React project"]},
    {"name": "Next.js", "type": "tool", "aliases": []},
    {"name": "build times", "type": "concept", "aliases": []}
  ],
  "claims": [
    {"subject": "Dave", "predicate": "is_migrating_to", "object": "Next.js"},
    {"subject": "Dave", "predicate": "dislikes", "object": "build times", "valence": -0.6}
  ]
}

EXAMPLE INPUT:
"GetProductized is a product management consultancy based in the Netherlands."

EXAMPLE OUTPUT:
{
  "entities": [
    {"name": "GetProductized", "type": "organization", "aliases": []},
    {"name": "the Netherlands", "type": "location", "aliases": ["Netherlands"]},
    {"name": "product management consultancy", "type": "concept", "aliases": []}
  ],
  "claims": [
    {"subject": "GetProductized", "predicate": "based_in", "object": "the Netherlands"},
    {"subject": "GetProductized", "predicate": "is_a", "object": "product management consultancy"}
  ]
}

EXAMPLE INPUT:
"We deployed without running the test suite and it broke production. Never do that again."

EXAMPLE OUTPUT:
{
  "entities": [
    {"name": "test suite", "type": "tool", "aliases": []},
    {"name": "production", "type": "concept", "aliases": []},
    {"name": "deploying without tests", "type": "constraint", "aliases": []}
  ],
  "claims": [
    {"subject": "deploying without tests", "predicate": "caused", "object": "production", "valence": -0.9},
    {"subject": "deploying without tests", "predicate": "must_avoid", "object": "production", "valence": -0.9}
  ]
}"""

ENTITY_TYPES = [
    "person",
    "organization",
    "project",
    "tool",
    "preference",
    "constraint",
    "location",
    "event",
    "concept",
    "goal",
]
