Tree-of-Thought Location Agent — an inspectable, correctable memory engine that learns places through observation and correction.
Project description
Tree-of-Thought Location Agent
A small learning agent that remembers places through observation, correction, and inspection.
The project starts with a simple idea: if an agent is going to build useful memory, it should be able to learn from direct experience, accept correction, preserve where its knowledge came from, and show what it thinks it knows. Right now that learning is anchored in locations. You can teach it a numeric observation, connect a media file to a place, rename labels, add aliases, and describe how places relate to each other.
It is not trying to be a finished vision model yet. The current version is a careful scaffold for one, with each sensor input normalized into an ObservationBundle before it reaches learning and memory.
| Status | Detail |
|---|---|
| Current phase | Phase 8, Modality-Neutral Observation Bundle |
| Last validated state | 177 automated tests passing |
| Next phase | Phase 9, Region Descriptors and Primitive Feature Extraction |
| Runtime style | Local interactive CLI |
| Dependencies | Python standard library only |
Preview
The agent runs in a terminal. You can give it a value, ask it to sense a local media file, correct its guesses, and inspect what it has learned.
agent online
observation[0.0-1.0|quit]: sense /path/to/bedroom.png
sensor: new image
label: bedroom
observation[0.0-1.0|quit]: sense /path/to/bedroom.png
sensor: recognized image
guess: bedroom (confidence=1.00)
correct?[1/0]: 1
observation[0.0-1.0|quit]: quit
goodbye
Behind that short exchange, the project stores a label node, a location model, sensor evidence, and an event log. If the same place later gets renamed or connected to a larger context such as a house, the old label and the enclosing context remain inspectable instead of disappearing.
What This Project Does
The agent learns location memory from two kinds of input:
- A grayscale-style value between
0.0and1.0, which gives the agent a small controlled observation space. - A local media file passed through
sense /path/to/file, which currently uses an image adapter and stores a normalized observation bundle.
When the agent recognizes something, it asks for confirmation. When it is wrong, you can correct it. When a label needs to change, you can rename it while keeping the old name as an alias. When one place contains or overlaps another, you can teach that relationship and later ask the agent to show the active context.
The important part is not that the first observation space is simple. The important part is that the memory is persistent, correctable, and visible.
Why It Exists
This project explores how a memory system can grow from grounded, inspectable pieces instead of starting as a sealed model that already claims to know the world.
The long-range direction is a synthetic memory-and-attention engine. Location learning is the entry point because it gives the system something concrete to anchor on: a place, a label, a correction, a relationship, and a record of evidence. Later phases expand that into region attention, primitive percepts, experience frames, memory units, replay, resurfacing, and reconsolidation.
One rule carries through the project: persisted memory should come from explicit user input or direct sensor input. The language model may help structure the interaction, but it is not treated as the source of truth.
Who It Is For
This repository may be useful if you are interested in:
- Learning systems that accept correction instead of treating the first answer as final.
- Memory that can be inspected, renamed, and repaired.
- Small agent architectures that grow in visible phases.
- Sensor and perception work that starts with a stable input contract before adding richer recognition.
- A local Python project that can be read without installing a framework.
For a non-technical reader, the project is easiest to understand as a working notebook for agent memory. For a technical reader, it is a compact Python implementation with tests, schema migrations, media fixtures, and roadmap documents.
Key Features
| Feature | What it means in practice |
|---|---|
| Persistent memory | Learned locations, labels, aliases, relations, sensor bindings, and observation bundles are stored under runtime/. |
| Correctable guesses | The agent asks whether a guess is right, then reinforces or corrects memory based on the answer. |
| Label history | Renames preserve the previous canonical name as an alias, so older vocabulary still resolves. |
| Nested context | contain can teach relationships such as house contains bedroom. |
| Overlapping context | overlap can record places that can be active together without forcing one parent-child shape. |
| Concept scaffold | concept, relate, and concepts let the project begin separating named ideas from locations. |
| Sensor preview | sense /path/to/file routes local media through an adapter and stores a bundle-backed sensor binding. |
| Inspectable state | inspect, context, persisted JSON, and JSONL event logs make the learned state visible. |
Visual Walkthrough
The current visuals are small generated fixtures used by tests and sensor examples. They are not polished screenshots, and that is intentional for now. They keep the project deterministic and easy to run offline while the perception layer is still being built.
| House context | Bedroom | Living room | Unknown scene |
|---|---|---|---|
These files are registered in media/catalog.json, explained in media/README.md, and staged through scenario files in media/scenarios/. Notes for future screenshots, GIFs, or demo videos live in docs/assets/README.md.
What Can I Do With This?
You can run the agent locally, teach it a few places, correct it, and inspect how its memory changes. A simple session might look like this:
- Teach
0.25askitchen. - Enter
0.253and confirm that it is stillkitchen. - Rename
kitchento a better label if needed. - Teach
house,bedroom, andliving roomfrom the included media fixtures. - Use
containto say thathousecontainsbedroomandliving room. - Use
inspectorcontextto see what the agent now believes.
The current sensor recognition is still a temporary exact-file preview at the binding layer. Phase 8 changes the interface around it, so media now enters as an ObservationBundle, but content-based visual understanding is still planned work.
Quick Start
Requirements: Python 3.12+ is preferred. No external packages are required.
# Run the interactive agent
python3 -m location_agent.cli
# Run in quiet mode for scripting or tests
python3 -m location_agent.cli --quiet
# Clear learned memory and exit
python3 -m location_agent.cli --reset
# Run the automated test suite
python3 -B -m unittest discover -s tests -v
During an interactive session, use sense /absolute/path/to/file to route a local media file through the sensor flow.
For fuller setup notes, memory isolation tips, and command examples, see docs/SETUP.md.
SDK Quickstart
location_agent also ships as a programmatic SDK. The Agent facade is the recommended entry point for embedding the learning loop in another application:
from location_agent import Agent
agent = Agent() # writes to ./runtime/
agent.learn_scalar(0.25, "kitchen")
result = agent.recognize_scalar(0.253)
print(result.is_known, result.label, result.confidence)
# True kitchen 0.94
snapshot = agent.inspect() # JSON-serializable
Public names are listed in docs/api.md and follow SemVer. Sensor adapters can be added via Python entry points — see docs/plugins.md.
Technical Notes
The README keeps the technical surface brief so the project remains readable from the outside. These supporting files hold the deeper details:
| Topic | Where to read more |
|---|---|
| Setup, local runs, reset behavior, commands | docs/SETUP.md |
| Architecture, schema v7, data flow, project structure | docs/TECHNICAL.md |
| Common errors and likely fixes | docs/TROUBLESHOOTING.md |
| Contribution workflow | docs/CONTRIBUTING.md |
| Media fixture and demo capture notes | docs/assets/README.md |
| Current phase validation | CURRENT_PHASE.md and VALIDATION.md |
| Long-range roadmap | PROJECT_ROADMAP.md and MEDIA_PLAN.md |
Contributing
The repository remote is https://github.com/ZSturman/Train-of-Thought-Agent.git.
Before changing behavior, run the test suite and check the current phase notes. The project is intentionally phase-driven, so documentation, media scenarios, and validation notes matter alongside code changes. See docs/CONTRIBUTING.md for the local workflow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tot_agent-0.7.0.tar.gz.
File metadata
- Download URL: tot_agent-0.7.0.tar.gz
- Upload date:
- Size: 51.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d37ca8ea55fe48612eee53ab6ff15f03d8acb55f46e680e6a9d505b64642565
|
|
| MD5 |
7c25aa344072d54496ce0ead27177e6a
|
|
| BLAKE2b-256 |
022cf08b31e398a9662573cdfcf9f454c2ffafd3775b59aa1b6a5d693fbc50c4
|
Provenance
The following attestation bundles were made for tot_agent-0.7.0.tar.gz:
Publisher:
publish-pypi.yml on ZSturman/Train-of-Thought-Agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tot_agent-0.7.0.tar.gz -
Subject digest:
8d37ca8ea55fe48612eee53ab6ff15f03d8acb55f46e680e6a9d505b64642565 - Sigstore transparency entry: 1437196278
- Sigstore integration time:
-
Permalink:
ZSturman/Train-of-Thought-Agent@1f1a354613759744648b51f9557293ed651eb929 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZSturman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1f1a354613759744648b51f9557293ed651eb929 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file tot_agent-0.7.0-py3-none-any.whl.
File metadata
- Download URL: tot_agent-0.7.0-py3-none-any.whl
- Upload date:
- Size: 48.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4a09f3702a78a00bb6c5ce6ecbbd74c90e1f8b672453bde8e7112686836bb2c
|
|
| MD5 |
9af092d8c5c647a6faa958be30e76d4e
|
|
| BLAKE2b-256 |
a7b6ca5b9bd445aa8b5cb0738fdf410642886e1cda1a412bb218095b16d15cfc
|
Provenance
The following attestation bundles were made for tot_agent-0.7.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on ZSturman/Train-of-Thought-Agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tot_agent-0.7.0-py3-none-any.whl -
Subject digest:
f4a09f3702a78a00bb6c5ce6ecbbd74c90e1f8b672453bde8e7112686836bb2c - Sigstore transparency entry: 1437196279
- Sigstore integration time:
-
Permalink:
ZSturman/Train-of-Thought-Agent@1f1a354613759744648b51f9557293ed651eb929 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZSturman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@1f1a354613759744648b51f9557293ed651eb929 -
Trigger Event:
workflow_dispatch
-
Statement type: