← Back to concept explainers

Concept Fable

Semantic function

Conclusion first:Semantic Function is an abstraction that wraps prompts or natural language instructions into callable units, commonly seen in Semantic Kernel. Like a function, it has a name, inputs, and outputs, and can be combined with native functions, plugins, and planners. Its value lies in turning prompts from scattered text into engineered capabilities, but it still requires version management, input constraints, evaluation, and permission boundaries.

Semantic Function · Prompt/function abstraction

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

A set of instructions that can be called

In the old kitchen there were two kinds of work. Chopping vegetables, weighing salt, and lighting the fire all had fixed methods; writing banquet menus, however, relied on the head chef explaining it verbally to apprentices. Doing the two kinds of work separately could barely get dishes out.

Later the banquets grew more and more complex. The accounts office wanted to connect menu generation to the order form, the front hall wanted to connect guest tastes to the recipe book, but the kitchen could only say: have the head chef explain it again.

Someone copied the chef's words onto a whole page and pasted it on the wall. Every time the taste, number of people, or budget needed to change, the apprentice manually edited a few sentences. The more the notes were edited, the messier they became, and no one knew which sentence was a variable and which was a rule.

Then someone wrote all the menus as hard code. This was stable, but it lost the flexibility of language. When customers said less oil, avoid spice, suitable for the elderly, the code table quickly expanded.

The new steward put the passage the chef often recited into a small wooden box. The box had a name and input fields: number of people, budget, dietary restrictions, cuisine. Give it these things, and it generates a menu according to that passage.

Beside it were ordinary toolboxes that could check inventory, calculate costs, and print purchase orders. The steward lined up the two kinds of boxes: first use the language box to produce a plan, then use the ordinary toolboxes to validate and execute.

The apprentice discovered that language was no longer just a prompt stuck on the wall, nor a special case hidden in the code. It had become a kitchen capability that could be invoked, composed and reused.

The steward still restricted the uses of the boxes. The menu box could not directly place purchase orders, and the purchasing box could not arbitrarily change customers' tastes. Each box had clear inputs, outputs, and boundaries. The head chef said: when a piece of natural-language instruction can be named, passed parameters, and composed like a function, it turns from oral experience into a system component. Later the kitchen made another banquet rewriting box. The front hall gave it customer preferences, and it produced only menu suggestions; the accounting office gave the purchasing box a budget, and it calculated only costs. The steward did not allow the two boxes to cross boundaries, because once the menu box could directly buy groceries, one wrong sentence would become a cartload of wrong goods. The kitchen thus preserved the flexibility of language while giving each instruction a fixed entry point, exit point, and scope of responsibility. Later the apprentice wrote example inputs and error outputs for each box. When a new chef took over, they did not have to guess the head chef's tone to know how that instruction should be used. Being callable also means being constrainable.

Reveal

This story is about: semantic functions

Semantic Function is an abstraction that wraps prompts or natural language instructions into callable units, commonly seen in Semantic Kernel. Like a function, it has a name, inputs, and outputs, and can be combined with native functions, plugins, and planners. Its value lies in turning prompts from scattered text into engineered capabilities, but it still requires version management, input constraints, evaluation, and permission boundaries.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Metaphor mapping

  • The chef gives verbal instructions: natural language prompt
  • Stickers on the wall: unmaintainable scattered prompts
  • Hard-coded menu: pure program logic that loses linguistic flexibility
  • Small wooden box with an input slot: Semantic Function
  • Number of people, budget, dietary restrictions: function input variables
  • Inventory, cost, procurement box: native functions or ordinary tools
  • Lined up in a row: semantic functions composed and orchestrated with code functions
  • Final insight: Semantic Function encapsulates prompts into callable, composable system capabilities

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

Semantic Kernelnative functionpluginprompt templateplanner
京ICP备2026014272号