Skip to content

nbursa/sentience

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentience (v0.1.1)

Sentience is an experimental, AI-native programming language built around:

  • Memory-first architecture (mem.short, mem.long, and potentially mem.latent)
  • Agent-based programming (goal, on input, reflect, train, evolve)
  • Contextual conditions (if context includes)
  • Embeddable REPL and optional file interpreter
  • Designed for exploring emergent agency, adaptation, and synthetic awareness

⚠️ This project is in an early research/prototyping phase.
It is not production-ready, may change significantly, and should be considered exploratory research.


Highlights

  • Memory-First Architecture
    All agent knowledge (short and long memory) is stored via simple key–value maps inside AgentContext.
  • Agent-Based Programming
    Define agents using agent Name { … } syntax (including goal: "…", on input(param) { … }, reflect { … }, train { … }, evolve { … }).
  • Contextual Conditions
    Inside any reflect block (or nested deeper), use if context includes "some_string" { … } to execute code only when the short-term memory (mem.short["msg"]) contains that substring.
  • Embeddable REPL
    Experiment interactively: register agents, send them input, train or evolve them, and immediately see how they react.
  • Designed for Emergent Intelligence Research
    A minimal language core that allows quick prototyping of synthetic‐agent behavior and introspection.

Quickstart

1. Clone and Build

git clone https://github.com/nbursa/sentience.git
cd sentience
cargo build --release

2. Run the REPL

cargo run --release

You should see:

Sentience REPL v0.1 (Rust)
>>>

3. Define and Register an Agent

Within the REPL, type an agent definition block. For example:

>>> agent Reflector {
...   mem short
...   goal: "Detect emotion in input"
...
...   on input(msg) {
...     embed msg -> mem.short
...     reflect {
...       if context includes "joy" {
...         print "You're radiating joy!"
...       }
...       if context includes "sad" {
...         print "I sense sadness..."
...       }
...     }
...   }
... }

After closing the } you’ll see:

Agent: Reflector
  Init mem: short
  Goal: "Detect emotion in input"
Agent: Reflector [registered]

4. Send Input to the Agent

Use the .input command:

>>> .input I am filled with joy today!
  You're radiating joy!
  • When you type .input I am filled with joy today!, the REPL finds the on input(msg) block of the registered agent, sets mem.short["msg"] = "I am filled with joy today!", then executes the body. In our example, the reflect block sees “joy” in the message and prints “You’re radiating joy!”.

5. Train or Evolve the Agent

Similarly, use:

  • .train <some_data> – triggers the train { … } block, setting mem.short["msg"] = <some_data> before running its body.
  • .evolve <some_data> – triggers the evolve { … } block in the same way.

If the agent does not have a train or evolve block, REPL will respond with, for example, Agent has no train block.


License

This repository is licensed under the MIT License. See the LICENSE file for details.

Contributors: Nenad Bursać


Contact

If you have questions, suggestions, or want to contribute, please open an issue or submit a pull request.


GitAds Sponsored

Sponsored by GitAds

About

Experimental AI-native programming language designed around memory and contextual agents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages