Skip to content
vishalkrishnaagPublic

About

AMU is a machine

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Intense

Intense is a compact Common Lisp symbolic AI. The Lisp model is both the reasoning engine and the learned state surface.

The Python layer is only the outside support loop: it parses the prompt, retrieves related Lisp model context with Ollama embeddings, asks Qwen for a small Lisp model-patch, and lets the Lisp model validate and absorb that patch.

Shape

  • src/model.lisp contains the symbolic AI: frames, links, answer logic, patch validation, and persistence.
  • src/learned-model.lisp contains approved learned Lisp frame data.
  • tools/config.py chooses the outside neural engine: OpenVINO for Intel CPU-only or lower-spec machines, Ollama otherwise.
  • tools/neuro_symbolic_agent.py connects terminal prompts to the Lisp model and Ollama.
  • train.py bulk-trains from text files by calling the same validated LLM patch loop chunk by chunk.
  • tests/smoke.lisp checks that the model can answer, learn from a patch, save, and reload.
  • run.sh is the terminal entrypoint.

There are no extra framework layers or external model folders. The model is simple on purpose.

Loop

user prompt
  -> Python prompt parser
  -> Lisp symbolic model
  -> known: answer directly
  -> unknown: return nearby Lisp model frames
  -> Ollama embeddings rank related Lisp model context
  -> Qwen proposes a model-patch
  -> Lisp validates patch as data, never evals generated code
  -> src/learned-model.lisp is updated
  -> Lisp model can answer next time

Test

./run.sh

Useful commands:

./run.sh lisp
./run.sh python
./run.sh ask "what is intense ai"
./run.sh learn "what is the characteristics of a dog"
./run.sh train notes.txt --max-chunks 3

Lisp Use

XDG_CACHE_HOME=/tmp/intense-cache sbcl
(require :asdf)
(load "intense.asd")
(asdf:load-system :intense)

(intense:answer! "intense-ai"
                 :intent :define
                 :question "what is intense ai"
                 :keywords '("intense" "ai"))

Teach the model with an approved patch:

(intense:apply-model-patch!
 '(model-patch
   :question "what are the characteristics of a dog"
   :reason "approved learning"
   :frames ((frame
             :id "dog"
             :type :concept
             :slots ((:summary . "Dogs are domesticated mammals.")
                     (:characteristics . ("loyal" "social" "trainable")))
             :links ((:relation :is-a
                      :target "mammal"
                      :weight 1.0
                      :evidence "approved learning"))
             :evidence ("approved learning")
             :history nil))))

Then:

(intense:answer! "dog"
                 :intent :describe-characteristics
                 :question "what are the characteristics of a dog"
                 :keywords '("dog" "characteristics"))

Ollama

If Ollama is running on Windows, WSL often reaches it at http://localhost:11434.

INTENSE_ENGINE=ollama \
OLLAMA_HOST=http://localhost:11434 \
OLLAMA_MODEL=qwen2.5-coder:3b \
OLLAMA_FALLBACK_MODEL=qwen2.5-coder:7b \
OLLAMA_EMBED_MODEL=nomic-embed-text \
./run.sh learn "what is the characteristics of a dog"

Use a lightweight coder model for Lisp patch generation and nomic-embed-text for embeddings:

ollama pull qwen2.5:0.5b
ollama pull qwen2.5-coder:3b
ollama pull qwen2.5-coder:7b
ollama pull nomic-embed-text

Engine Config

The Python support layer reads tools/config.py. Defaults:

INTENSE_ENGINE=auto
INTENSE_PROMPT_ENCODER=auto
OLLAMA_UNDERSTAND_MODEL=qwen2.5:0.5b
OLLAMA_MODEL=qwen2.5-coder:3b
OLLAMA_FALLBACK_MODEL=qwen2.5-coder:7b
OLLAMA_EMBED_MODEL=nomic-embed-text
INTENSE_USE_FALLBACK=1

auto chooses:

  • openvino for Intel CPU-only or lower-spec machines when the OpenVINO runtime and model path are available.
  • ollama for machines with stronger discrete GPU/high-spec path or non-Intel CPU.
  • ollama as a fallback when OpenVINO would be preferred but is not installed/configured.

OpenVINO routing is a future acceleration path. The current working generation path is Ollama, and you can force it with:

INTENSE_ENGINE=ollama ./run.sh learn "what are the characteristics of a platypus"

Prompt Understanding

The first layer uses a small Ollama model to translate natural language into the symbolic request fields intent, topic, and keywords. The old deterministic parser remains only as a fallback when the micro model is unavailable or returns invalid JSON.

INTENSE_PROMPT_ENCODER=auto
OLLAMA_UNDERSTAND_MODEL=qwen2.5:0.5b

Strict or fallback-free debugging:

./run.sh ask "explain why rain forms after evaporation" --prompt-encoder llm
./run.sh ask "what is intense ai" --prompt-encoder deterministic

Bulk Training

Use train.py when you want to teach from a novel, notes, or an informational text file. It does not write knowledge directly. It splits the source into chunks and calls tools/neuro_symbolic_agent.py --learn --auto-apply, so every update still goes through Ollama generation, Lisp patch validation, fallback handling, and the normal merge logic.

INTENSE_ENGINE=ollama ./run.sh train source.txt

By default, after every 10 successful chunks, train.py runs a sequence review pass. That pass asks the existing learner to consolidate timelines, ordered steps, cause-effect chains, before/after relations, likely next items, and missing sequence gaps from the learned context. It is still just another validated model-patch; it does not bypass the symbolic model.

Useful safer runs:

./run.sh train source.txt --dry-run --max-chunks 2
./run.sh train source.txt --chunk-chars 2200 --continue-on-error
./run.sh train source.txt --sequence-every 0
./run.sh train source.txt --sequence-every 5 --sequence-window 5

About

AMU is a machine

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages