What This Library Does
AgenticChunkingHelpers is a stateless C# External Logic library for OutSystems Developer Cloud. It handles the text processing work on either side of your AI Gateway calls for Level 5 Agentic Chunking workflows.
The library exposes three Server Actions: PreChunkForExtraction, ParsePropositions, and NormaliseAgenticOutput. Each is stateless and side-effect free. The library does not call the AI Gateway, store state, or validate business rules. All of that belongs in your ODC App.
InstallationFrom the Forge (recommended)
The easiest way to install this library is through the Agentic Chunking ODC component on the OutSystems Forge. Installing that component automatically installs AgenticChunkingHelpers as a dependency. No separate steps required.
Manual installation from GitHub
If you need to install the library directly:
The library will appear as AgenticChunkingHelpers in your ODC tenant's External Logic list.
ActionsPreChunkForExtraction
Call this before your first AI Gateway call. It splits a large source text into token-safe batches, respecting paragraph and sentence boundaries so the extraction model receives coherent input.
Input parameters
Output
Configuration notes
Set maxTokensPerBatch conservatively. The 2000 default leaves headroom for the system prompt and user message wrapper your AI Gateway call adds around the batch text. If your extraction system prompt is longer than average, reduce this value.
ParsePropositions
Call this immediately after each extraction AI Gateway call, before moving to the next batch. It parses the raw response string into a clean list of proposition strings.
The action handles the response variations the model commonly produces: Markdown code fences around the JSON array, doubled quotes from ODC's string escaping, and outer-quoted responses. You do not need to pre-process the response before passing it in.
Expected AI Gateway response shape
The extraction prompt must instruct the model to return a plain JSON array of strings with no preamble and no code fences. The expected shape is:
["Proposition one.", "Proposition two.", "Proposition three."]
If the model returns anything outside this shape, ParsePropositions returns an empty list. Check the list length before accumulating into your AllPropositions list.
NormaliseAgenticOutput
Call this after your grouping AI Gateway call. It parses the raw grouping response and maps it to typed AgenticChunk structures ready for use in ODC.
Returns an AgenticResponse structure containing:
Each AgenticChunk contains:
The grouping prompt must instruct the model to return a JSON array of objects. Each object must have a category field (string) and a facts field (array of strings). The expected shape is:
[{"category": "Cloud Infrastructure", "facts": ["Kubernetes is a container orchestration platform.", "Kubernetes automates deployment of containerised applications."]}]