What changes?
Models, tools, agents, and actions have dedicated language constructs. Calling a declared action prepares it; its body runs only when committed. The local inspector lets you explore the program’s declared tools, actions, and state.
Write model calls, tools, memory, and action permissions in one readable program. Reuse Python libraries for the work underneath.
Python 3.10+ · MIT licensed · Early development
Python-like syntax
BYO-LLM
Explicit side effects
Human control
THE PROBLEM
Calling an AI model is one step. You still need code to store information, track changes, connect tools, and check permissions.
For example, a support assistant needs to remember a customer’s preference, check its earlier value, look up an order, and get approval before issuing a refund. You have to connect these parts and keep their rules clear as the application grows.
Sense puts memory, history, tools, and policies into the language. The goal is to reduce repeated setup code and make these rules easier to read and change. Python and frameworks can do this too; Sense offers a consistent way to write it.
WHY SENSE?
An AI workflow is a program that connects model decisions to tools and other steps. Sense aims to make those connections explicit and reduce repeated setup code.
Models, tools, agents, and actions have dedicated language constructs. Calling a declared action prepares it; its body runs only when committed. The local inspector lets you explore the program’s declared tools, actions, and state.
Try a small report, support, or operations workflow where you want to read the model steps and execution rules together. For example: draft a response, prepare a send operation, then check it before execution.
You learn new syntax and use an early runtime. Python and agent frameworks can implement similar workflows. Keep your current tools if they already meet your needs; Sense is an option to explore, not a required migration.
Sense is a small domain-specific language implemented in Python. Its goal is clearer workflow code, not better model intelligence or automatic completion of any goal. See how it fits with existing tools ↓
01 / THE LANGUAGE
Declare the model, store context, and decide when an action runs. These examples show the current syntax.
Choose a model and ask a question. The Answer records its value and source; confidence can be unknown.
Explore reasoning ↗# A model is a value. Reasoning is built in.
model reasoning = inference("openai", "gpt-4o")
set delegation = reasoning
result = ask("What should we build next?")
print(result.value)
print(result.confidence)
print(result.source)
02 / INTELLIGENCE, BUILT IN
Use models and tools, retain information with memory, inspect its history, and set permissions with policies. Agents and sessions organize these pieces.
ask → Answer↗
An Answer records the response and model source. Confidence may be nil; the wrapper does not prove the answer is correct.
agent / session↗
Agents have identity, state, and a pause/resume lifecycle. Sessions keep context and delegation scoped.
persistent memory↗
Use memory for working information, or persistent memory to keep it across runs. Recall the latest value, inspect its history, or read a value at an earlier version.
tool / skill / connect_mcp↗
Give models capability-checked tools. Connect MCP servers and reach installed packages through Python interop.
MEMORY + HISTORY
Keep the current value and the changes that led to it.
Store a report’s status as it moves from draft to reviewed. Persistent memory records each update, so you can inspect earlier values without maintaining a separate history list.
persistent memory reports
reports.remember("status", "draft")
reports.remember("status", "reviewed")
print(reports.recall("status"))
print(reports.history("status"))
print(reports.as_of("status", 1))
On a new store: the latest status is “reviewed”; version 1 is “draft”. Re-running appends more history. Reading an older version does not undo external actions.
Explore persistent memory ↗POLICY + SCOPE
Write permission rules where the work happens.
Allow a research step to use a search tool while denying a send operation. A tool or action declares its required capability; policy supplies the rule used when that capability is checked.
session research:
policy:
allow web.search
deny email.send
# Rules for this scope.
# Add tools and work here.
This block declares rules; it does not perform a search. Inner scopes can override outer rules. Unmentioned capabilities default to allow, and arbitrary Python calls are not sandboxed.
Explore scoped policies ↗03 / DELIBERATE BY DESIGN
An action has a lifecycle. Preparing it does not run its effect. Permissions are checked by the interpreter, and the effect happens only when you commit.
Understand the safety model ↗prepare
Bind the arguments. The action body has not run.
verify()
Check the action against your policy.
commit()
Re-check permissions. Perform the effect.
CHOOSING AN APPROACH
There are several ways to build an AI workflow. The difference is how you write it and which parts the tool provides.
| Approach | What it provides | When to consider it |
|---|---|---|
| Python + libraries | General-purpose code and your choice of model and application libraries. | You want to stay in an existing Python application and choose its workflow structure. |
| LangChain | Agent building blocks and integrations for models, tools, and agent loops. | You want existing agent abstractions through framework APIs. |
| LangGraph | Stateful orchestration, persistence, durable execution, and human oversight. | You need explicit orchestration and support for work that spans interruptions. |
| Deep Agents | An agent harness with planning, filesystem tools, subagents, and context management. | You want those capabilities supplied as a starting point for your agent. |
| Sense | Workflow concepts expressed in a small language, with a Python-based interpreter and local inspector. | You want to explore explicit workflow syntax and can accept an early runtime and a new language to learn. |
Human oversight, memory, and agent state are not unique to Sense. Its goal is to make workflow code clearer through language constructs. It does not claim faster execution, better model answers, or feature parity with these tools.
Tool descriptions follow the official LangChain product guide, LangGraph overview, and Deep Agents overview. Checked September 7, 2026. This is a guide to their roles, not a complete feature ranking.
COMMON QUESTIONS
Straight answers about the language, existing tools, and what you still need to build.
Sense has its own syntax, parser, and interpreter, so it is a domain-specific language. The interpreter is written in Python and can call installed Python libraries. That describes the implementation; the practical reason to try it is whether its workflow structure helps you.
You can build the same kind of workflow in Python. Sense puts models, tools, policies, and action stages into a consistent language structure. It is worth exploring if that makes your code easier to read and change. It does not claim to be faster or to replace Python’s ecosystem.
You can build agents with LangChain, LangGraph, or Deep Agents. Sense offers another way: write model calls, memory, and permissions directly in your code.
For example: save a value, check its history, allow a search, or require approval before sending an email.
AI can write the code and choose the steps. You still decide what your application can do.
Why try Sense? To see whether these built-in features make your code simpler to write, read, and maintain.
No. You still choose tools, write instructions, configure models, and define execution rules. Sense provides a way to express that program. It does not make a model more capable or guarantee that it achieves the goal.
Generated code still needs review, maintenance, and debugging. Sense aims to make the workflow rules easier to see. That only helps if you find the resulting code clearer; AI code generation alone is not a reason to adopt another language.
No rewrite is needed to try an isolated Sense script. It can call installed Python modules through Python interop. Existing Python code does not automatically become Sense code, and compatibility with a library or framework needs checking. Start with one small workflow.
Sense also has functions, variables, conditions, loops, imports, and return values. Use
local when you need a new local binding rather than updating an existing outer
one. return produces a result; returns annotates a result type on
constructs such as tools. Start with ordinary code and add memory, policies, or agents when
your program needs them. See the
full keyword reference.
Start with a function. Use a tool for model-callable work or capability checks, an action when execution needs a separate commit, and an agent when you need task state and pause/resume.
model declares a model value. set delegation selects the model for
the current scope, and ask(...) uses that selection. The returned
Answer has a value, source, and confidence field. OpenAI and Anthropic are
supported today, and more provider integrations are planned. Their confidence is currently
nil, meaning unknown. An Answer is not proof that the response is correct.
No. An agent runs the code you put in its body. It can use ordinary functions, memory, tools, and model calls as needed. Use a model when the task needs it; the agent keyword itself does not call a model or decide what to do.
A session runs a block in a child scope, letting you choose a model or policy
for that work without changing the outer setting. An agent has identity,
execution state, and a start/pause/resume lifecycle. Use a session to scope work and an
agent when that lifecycle is useful. Neither means crash recovery is automatic.
Yes. Your code can call a tool directly. Its declared capability is checked and its body runs
if permitted. Offering it through ask_with_tools(...) additionally lets the
model request it. A tool is not limited to model-selected calls.
A skill(...) groups related tools under a name and description. For example,
bundle order lookup and shipment tracking tools for reuse. Pro: pass one
bundle instead of repeating the same tool list. Con: it is another grouping
to maintain and does not write the tools for you. A skill is a value created by a function,
not a separate agent.
memory holds key/value information in the running process.
persistent memory saves supported values in a SQLite-backed store across runs
and records changes as versions. Use working memory for temporary notes and persistent
memory when later runs need the information. This is data storage, not automatic model
learning.
remember(key, value) stores a value; recall(key) reads the latest
one. Persistent memory also provides history(key) to list changes and
as_of(key, version) to read an earlier value. For example, inspect when a
stored status changed from draft to reviewed. These are methods on memory, not separate
reserved keywords.
For ordinary memory, forget(key) removes the current entry. For persistent
memory, it records a removal while retaining earlier versions. Recall then returns
nil, but history remains available. Do not use forget as a promise to erase
sensitive data from storage.
No. Declaring memory stores data; it does not automatically add it to every prompt. Use
ask_with_memory(...) when you want stored context included in a model request.
Choose what you store and share; persistent data can still be outdated or incorrect.
requires names a capability on an operation, such as web.search. A
policy block uses allow or deny to set its
permission. The runtime checks that declared capability when the operation is used. Action
verification and commit each check permissions. These rules do not inspect whether the
content of an operation is a good decision.
Rules are scoped. The nearest matching rule is used, and an inner scope can override an outer rule. A capability without a matching rule defaults to allow. Policies govern declared capabilities; they are not an operating-system sandbox or an automatic block on all Python side effects.
No. Use requires approval when the action needs approval before commit. Without
that requirement, an action still has preparation, verification, and commit steps, but does
not automatically ask a person. You must connect the approval step to the appropriate person
or application process.
No. You write the recovery logic for operations that support it. Compensation can fail and may not fully undo an external effect. Sending a correction does not unsend an email. Sense does not generate an undo operation for you.
async enables concurrent agent or tool work; it does not automatically make
shared application state safe. requires approval adds an approval requirement
before an action can commit. import python connects installed Python
functionality. These features serve different purposes: concurrency, an execution gate, and
integration.
Sense currently integrates OpenAI and Anthropic, with more LLM provider integrations planned.
Select one with inference("openai", ...) or
inference("anthropic", ...). Each needs its provider package, an API key, and
an internet connection. Check the documentation for the latest supported providers as
integrations are added.
For OpenAI, install pip install "sense-lang[openai]" and set
OPENAI_API_KEY. For Anthropic, install
pip install "sense-lang[anthropic]" and set ANTHROPIC_API_KEY.
Choose a model available to your provider account. Installing Sense alone does not include
provider access or API credits.
No. The mock provider returns configured demo responses; it does not run an LLM or perform local inference. Real model responses use an integrated provider. OpenAI and Anthropic are supported today, with more integrations planned. Ordinary code, memory operations, and local examples can run without calling a model.
Sense is in early development. Evaluate it on small, low-risk workflows first. Its capability checks are not a sandbox for arbitrary Python code, and pausing an agent is not a promise of recovery after a process crash. Review the implementation and limitations before depending on it.
YOUR NEXT PROGRAM STARTS HERE
Connect a supported LLM provider to run model calls. OpenAI and Anthropic are available today, with more integrations planned.
Follow the quickstartInstall Sense
Open the interactive shell
A young language, built in the open. Sense is in active development. Explore the current implementation and help shape what comes next.
Read the docs ↗