Skip to content

Instantly share code, notes, and snippets.

@CodeWithOz
Last active August 26, 2025 22:34
Show Gist options
  • Select an option

  • Save CodeWithOz/0b01d558adac703673aceca48471dca7 to your computer and use it in GitHub Desktop.

Select an option

Save CodeWithOz/0b01d558adac703673aceca48471dca7 to your computer and use it in GitHub Desktop.
Agent for cleaning up named entities in YouTube video transcripts.
...
class DemoEnrichmentAgent:
...
async def extractor_node(self, state: AgentState):
sys_prompt = SystemMessage(
content=(
'You are a master at data extraction. '
'You will receive the transcript of a YouTube video. '
'Extract all entities named in the video and '
'provide some context for each one. '
'ONLY output a JSON array of items each with 2 keys: '
'`entity_name` and `entity_context`. For example, '
'`[{ "entity_name": "Jamaican", "entity_context": "vacation spot" }]`. '
'The context will be used for a web search so it should be '
'brief and without fluff.'
)
)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment