This looks really cool! After building various logic programming engines on top of Janet: https://codeberg.org/veqq/declarative-dsls I was considering something similar (though more bare bones). I'd love to talk to the maintainer to discuss certain design choices etc. Maybe I can wrap it instead of SQLite and Prolog directly as I was thinking.
I'm developing a similar project, I also added scripts to it so it works like an hermetic/replayable system too. Do you use yours for anything cool? Maybe a truth maintenance system of sorts? Do the queries get unwieldy at some point?
Ah, interested to dive in—and have a project it could integrate with.
I built a similar thing recently, for agents, aimed at enabling prolog queries over handles in markdown corpora (and code): https://github.com/flowerornament/anneal. A true slopwerk in comparison to this, however.
Awesome work! If I understand it correctly, it loads relevant subgraphs from the DB and then runs queries in Prolog on it? Or is it more similar to datalog?
I'm curious, what inspired the workflow? The usecase strikes me as similar to a usecase I have with the normal Prolog REPL. Why an SQL database instead of of loading/unloading files? Did you run into scaling issues?
Hi, project developer here,
I developed this project (kb-prolog) and its sibling (Humanist) as an experiment to try and improve the way I handle information (normally scattered in plain files and directories) by building structure on top that, ideally, should represent the semantic closeness of information entities (e.g. files and concepts).
I used a content addressable storage inspired by Nix to bridge unstructured information in files with the system I am building. Then I combined SQLite as the persistence layer and Trealla Prolog as the logic layer for knowledge representation and inference. I began trying to use C to orchestrate all these components, but switched to a Prolog core after struggling with reliable read and write access from C to the in-memory predicates in Trealla. I tried as much as possible keeping the program self-contained. I ended up with this statement predicate as KR building block which behaves as an RDF triple with properties.
Right now, the project's bottleneck is data ingestion, since constructing the statements manually is tedious. I have tried using LLMs to generate Prolog files with facts to be ingested, and that works, but is not friction-less.
The project is meant as a personal knowledge management tool that responds to my informational needs (and hopefully some else's too). In that regard, I wanted to try to implement context tracking. This is an idea I had in which, when you are multi-tasking, you need to switch contexts often depending on task, project, or life aspect you are considering at any given moment. This makes tracking the individual (and sometimes interdependent) state of each of these things hard. The goal of context tracking is to provide a way to load or visualize the exact context you need for the thing you are focusing on at this precise moment. The program may store and entire knowledge graph which you can load, but also allows loading only the subgraph around a selected entity. Version history of the knowledge graph is also important since you want to track its evolution. Humanist provides a more polish interface with similar capabilities.
Any feedback on how to take these ideas further would be awesome.
10 comments
[ 3.1 ms ] story [ 29.2 ms ] threadI built a similar thing recently, for agents, aimed at enabling prolog queries over handles in markdown corpora (and code): https://github.com/flowerornament/anneal. A true slopwerk in comparison to this, however.
I used a content addressable storage inspired by Nix to bridge unstructured information in files with the system I am building. Then I combined SQLite as the persistence layer and Trealla Prolog as the logic layer for knowledge representation and inference. I began trying to use C to orchestrate all these components, but switched to a Prolog core after struggling with reliable read and write access from C to the in-memory predicates in Trealla. I tried as much as possible keeping the program self-contained. I ended up with this statement predicate as KR building block which behaves as an RDF triple with properties.
Right now, the project's bottleneck is data ingestion, since constructing the statements manually is tedious. I have tried using LLMs to generate Prolog files with facts to be ingested, and that works, but is not friction-less.
The project is meant as a personal knowledge management tool that responds to my informational needs (and hopefully some else's too). In that regard, I wanted to try to implement context tracking. This is an idea I had in which, when you are multi-tasking, you need to switch contexts often depending on task, project, or life aspect you are considering at any given moment. This makes tracking the individual (and sometimes interdependent) state of each of these things hard. The goal of context tracking is to provide a way to load or visualize the exact context you need for the thing you are focusing on at this precise moment. The program may store and entire knowledge graph which you can load, but also allows loading only the subgraph around a selected entity. Version history of the knowledge graph is also important since you want to track its evolution. Humanist provides a more polish interface with similar capabilities.
Any feedback on how to take these ideas further would be awesome.