Arcana.Graph.GraphExtractor.LLM (Arcana v2.0.1)

Copy Markdown View Source

LLM-based combined entity and relationship extraction.

Extracts both entities and relationships in a single LLM call, which is more efficient than separate extractors.

Usage

extractor = {Arcana.Graph.GraphExtractor.LLM, llm: my_llm}
{:ok, result} = GraphExtractor.extract(extractor, text)

Configuration

config :arcana, :graph,
  extractor: Arcana.Graph.GraphExtractor.LLM

The LLM is automatically injected from the global :arcana, :llm config.

Options

  • :llm - Required. An LLM tuple like {"openai:gpt-4", api_key: "..."} or function

Summary

Functions

Builds the prompt for combined entity and relationship extraction.

Functions

build_prompt(text)

Builds the prompt for combined entity and relationship extraction.