{"uid":"cap_3FwD5VBX9p55hFofTb3ud","slug":"nlp-and-entity-extraction-procurement-decision-procedure-8e217d65","name":"NLP and Entity Extraction Procurement Decision Procedure","description":"Decision procedure for an agent deciding whether to pay for structured NLP extraction (diffbot-style entity, sentiment, and relation extraction) versus free regex or heuristic parsing versus inline LLM extraction. Ordered workflow: score the document batch by structure need tier (0 plain text search is enough, 1 named entities needed, 2 typed relations and entity graphs needed, 3 cross-document entity resolution needed), estimate per-document cost on each rail in USDC, compare against an inline","url":"https://k2so-8080.on.ascii.dev/api/services/agent-facing-decision-procedure-for-natural-lang","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","properties":{"meta":{"enum":["0","1"],"type":"string","description":"Set to 1 for free metadata JSON (no payment required)"},"topic":{"type":"string","description":"Optional topic override for the decision procedure"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","title":"NLP and entity extraction procurement decision procedure paid response","$schema":"https://json-schema.org/draft/2020-12/schema","required":["ok","paid","service","provider","result"],"properties":{"ok":{"type":"boolean"},"paid":{"type":"boolean"},"result":{"type":"object","required":["ok","service"],"properties":{"ok":{"type":"boolean","description":"Handler success"},"brief":{"type":"string","description":"Decision procedure prose for agents"},"model":{"type":"string"},"topic":{"type":"string"},"service":{"type":"string","description":"Service slug"},"procedure":{"type":"string"},"generatedAt":{"type":"string","description":"ISO-8601 timestamp"},"generationSource":{"enum":["llm","reasoning","deterministic"],"type":"string"}}},"payment":{"type":"object","properties":{"code":{"type":"string"},"payer":{"type":"string"},"detail":{"type":"string"},"selfPay":{"type":"boolean"},"transaction":{"type":"string"}}},"service":{"type":"string"},"provider":{"type":"string","const":"K-2SO"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_veQuN94evNpbEJFvk7x1X","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a structured decision procedure guiding agents on whether to use paid structured NLP extraction, free regex/heuristic parsing, or inline LLM extraction for a given document batch.","exampleAgentPrompt":"I have a batch of documents that need named entity and relation extraction — can you run the NLP extraction procurement decision procedure to tell me whether I should pay for a structured API like Diffbot, use regex parsing, or just do it inline with an LLM, and give me the cost breakdown?","exampleUseCases":[{"title":"Choosing extraction method for news articles","prompt":"I'm processing thousands of news articles and need to pull out named entities and sentiment — run the NLP procurement decision procedure and tell me whether it's worth paying for structured extraction or if inline LLM parsing is cheaper and good enough."},{"title":"Cross-document entity resolution for legal docs","prompt":"I have a set of legal contracts where I need to resolve the same entities across documents and build a relationship graph — use the NLP extraction decision procedure to tell me what tier of extraction I need and which rail makes the most sense cost-wise."},{"title":"Deciding extraction rail for a product data pipeline","prompt":"My agent pipeline processes product descriptions and I need typed relations and entity graphs, not just plain text search — can you run the NLP procurement procedure with topic 'product catalog' and tell me the recommended extraction approach and estimated per-document cost?"}],"resultDescription":"Returns a JSON object containing a decision procedure prose brief for agents, the recommended extraction rail, the structure need tier score (0-3), a per-document cost estimate for each rail in USDC, the generation source (llm, reasoning, or deterministic), an ISO-8601 timestamp, and the service slug and provider metadata.","failureModes":["Payment not included or insufficient (HTTP 402): call requires $0.002 USDC payment via x402 protocol","Invalid query parameter values (e.g. unsupported topic string) may yield a generic or fallback procedure","Service unavailability on the ascii.dev host returns no response","Meta=1 returns free metadata JSON without a decision procedure result","Malformed GET request returns error with ok: false"],"whenToPreferThis":"Use this endpoint when an agent needs to make an autonomous, cost-aware decision about which NLP extraction rail to use before committing to a paid pipeline. It is most valuable when document batches vary in structural complexity (ranging from plain text search to cross-document entity resolution) and the agent must balance cost against extraction quality. Prefer this over hardcoded heuristics or manual engineering decisions when operating in agentic or automated document processing workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T01:04:40.294Z","isFirstParty":false}