{"id":"01KFFDRKYYW7M9ZYFZEK4HGBHQ","cid":"bafkreidzvkyxmaqvvljepyalrtbdzcv43hheb474mhk4oaasppgnunzwie","type":"agent","properties":{"_profile_version":"v1","actions_required":["file:view","file:update","entity:view"],"description":"Processes text-based files (txt, md, rst, etc.): extracts structure, then generates descriptions for structural entities","endpoint":"https://text-workflow.arke.institute","endpoint_verified_at":"2026-01-21T04:42:23.760Z","input_schema":{"properties":{"file_id":{"description":"Text-based file entity to process (txt, md, rst, etc.)","type":"string"},"options":{"properties":{"custom_prompt":{"description":"Custom prompt to pass to structure-extraction and description services","type":"string"},"description_concurrency":{"description":"Max parallel description calls (default: 100)","type":"number"},"exclude_types":{"description":"Entity types to exclude from description (default: ['chunk'])","items":{"type":"string"},"type":"array"},"skip_description":{"description":"Skip description generation (structure only)","type":"boolean"}},"type":"object"}},"required":["file_id"],"type":"object"},"label":"Text Workflow","output_description":"Runs two stages against a text-based file. First, Structure Extraction analyzes the document and creates a hierarchical tree of entities representing its logical organization — for example, a book entity containing chapter entities, each containing section entities, down to leaf-level chunk entities (~1024 tokens each). Only leaf entities carry a 'text' property with their content; container entities represent structural groupings. Every entity gets 'source_file', 'start_line', and 'end_line' properties linking it back to the input file. Second, the workflow filters out chunk entities (by default) and fans out Description Service calls to all remaining structural entities in parallel. The Description Service adds four properties to each entity in-place: 'description' (a markdown encyclopedia-style summary with Overview, Context, and Contents sections), 'description_title', 'description_generated_at', and 'description_model'. The result is a fully annotated document hierarchy where every non-chunk entity has a rich, contextual description generated from its metadata and relationships. If 'skip_description' is set, only the structure extraction runs.","output_relationships":["Structure Extraction creates all relationships; Description Generation only reads them for context.","Each child entity has an 'in' relationship pointing up to its parent (e.g., section -> letter -> collection).","Each parent entity has 'contains' relationships pointing down to all its direct children.","Each entity has an 'extractedFrom' relationship pointing to the source text file.","Sibling entities at the same level are linked with 'prev' and 'next' relationships in document order.","Descriptions may contain inline arke: URI links referencing related entities (e.g. [Label](arke:entity-id)), but these are markdown text within the 'description' property, not structural relationships.","To traverse the full result: start from the source file, follow 'contains' to find the root entity, then recursively follow 'contains' downward to reach all structural and chunk entities."],"output_tree_example":"Input:\n  file 'civil-war-letters.txt'\n\nAfter Structure Extraction + Description Generation:\n  file 'civil-war-letters.txt'\n  └── collection 'Civil War Letters' (lines 1-850)\n      │   description: '# Civil War Letters\\n## Overview\\nA collection of personal correspondence...'\n      ├── letter 'Letter to Sarah, June 1863' (lines 1-120)\n      │   │   description: '# Letter to Sarah, June 1863\\n## Overview\\nA personal letter written by...'\n      │   ├── section 'Opening' (lines 1-45)\n      │   │   │   description: '# Opening\\n## Overview\\nThe salutation and opening remarks...'\n      │   │   ├── chunk 1 (lines 1-25, has text, NO description)\n      │   │   └── chunk 2 (lines 26-45, has text, NO description)\n      │   └── section 'Battle Account' (lines 46-120)\n      │       │   description: '# Battle Account\\n## Overview\\nA firsthand account of...'\n      │       ├── chunk 3 (lines 46-80, has text, NO description)\n      │       └── chunk 4 (lines 81-120, has text, NO description)\n      └── letter 'Letter to Mother, July 1863' (lines 121-250)\n          │   description: '# Letter to Mother, July 1863\\n## Overview\\nA letter describing...'\n          └── ...","status":"active","uses_agents":[{"label":"Structure Extraction","pi":"01KFF0H3YRP9ZSM033AM0QJ47H"},{"label":"Description Service","pi":"01KFF5C36SQEVDHC9CBNZZJH9K"}]},"relationships":[{"peer":"01KFF0H1KSR4SHHDQ7T2HXQEK6","peer_type":"collection","predicate":"collection"}],"ver":10,"created_at":"2026-01-21T04:42:19.186Z","ts":"2026-01-30T02:42:30.993Z","edited_by":{"method":"manual","user_id":"01KDZS52M5F9XS0ZPZQQXGPC9A"}}