Rendered at 14:22:32 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
mat-mgm 2 hours ago [-]
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.
veqq 4 days ago [-]
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.
gobdovan 4 days ago [-]
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?
veqq 4 days ago [-]
What inspires your project etc.? I'm open to collaborating.
gobdovan 3 days ago [-]
Relational algebra, EAV model, MVCC, Nix and a few principles around removing data only if you can prove it's reconstructible some other way.
My email's on my profile.
tern 3 days ago [-]
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.
schmuhblaster 3 days ago [-]
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?
snthpy 3 days ago [-]
Looks cool. A somewhat adjacent question: what is the best, or what are common, approache(s) for handling time in knowledge graphs?
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?
srean 3 days ago [-]
It would be good to link the Masters thesis too. I looked for it but could not find.
shaism 4 days ago [-]
What would be a good use case for this?
Spooky23 3 days ago [-]
Years ago I worked on an event system that correlated about 500k daily events to about 40 actionable daily events.
A big part of it used prolog to map artifacts to application to business and technical accountable individuals. So if a down storage device offlined a database and broke an app, the business user and storage guy would be called or paged.
My team does this with Splunk today. For probably 50x the compute and 10x the cost.
shaism 3 days ago [-]
I see. Cool. So did you generate the inference / reasoning rules to map those 500k events to 40 by hand or are there solutions to automatically discover those rules based on past incidences?
Spooky23 3 days ago [-]
This was almost 20 years ago now so yes and no!
We wired up the network monitoring systems which built out the hierarchy of network gear, then used a fairly lightweight filter/rules engine to dedupe and normalize events. For example a Cisco 6500 switch might throw 100 events when an interfere dropped. We could roll 90% of them with the filter. Another device would send a junk “interface down” alert periodically… except an attribute would say “is_down=false” lol
So we pulled in our business-artifact mapping system (this would be ServiceNow today), the on-call rosters, the network topology, runbook/kb, and some other goodies and grabbed the attention of the right person at the right time with specific guidance about what to do.
Basically if a switch, server or critical app failed, we immediately knew what system was impacted, the scope of the impact, who to inform and who to call to resolve. Eventually we expanded it to batch non-critical failures and schedule repairs during outage windows and identify specific dev teams for components of larger apps.
I left after that. It was a fun project and a big break for me, all because I was the only person who had heard of prolog in a happy hour conversation!
shaism 22 hours ago [-]
Thanks for sharing!
ux266478 3 days ago [-]
> are there solutions to automatically discover those rules based on past incidences?
While it's not exactly what he did, the answer to this question is yes. That's called inductive logic programming. Essentially you provide background knowledge, positive examples and negative examples, and it spits out a logic program. It's where the frontier of symbolic AI has sat for a hot second now.
shaism 21 hours ago [-]
Thanks! There is something magical about those symbolic approaches. But in practice, they seem to often fall short of expectations. Wonder whether there will be another "symbolic AI summer" one day.
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.
My email's on my profile.
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.
A big part of it used prolog to map artifacts to application to business and technical accountable individuals. So if a down storage device offlined a database and broke an app, the business user and storage guy would be called or paged.
My team does this with Splunk today. For probably 50x the compute and 10x the cost.
We wired up the network monitoring systems which built out the hierarchy of network gear, then used a fairly lightweight filter/rules engine to dedupe and normalize events. For example a Cisco 6500 switch might throw 100 events when an interfere dropped. We could roll 90% of them with the filter. Another device would send a junk “interface down” alert periodically… except an attribute would say “is_down=false” lol
So we pulled in our business-artifact mapping system (this would be ServiceNow today), the on-call rosters, the network topology, runbook/kb, and some other goodies and grabbed the attention of the right person at the right time with specific guidance about what to do.
Basically if a switch, server or critical app failed, we immediately knew what system was impacted, the scope of the impact, who to inform and who to call to resolve. Eventually we expanded it to batch non-critical failures and schedule repairs during outage windows and identify specific dev teams for components of larger apps.
I left after that. It was a fun project and a big break for me, all because I was the only person who had heard of prolog in a happy hour conversation!
While it's not exactly what he did, the answer to this question is yes. That's called inductive logic programming. Essentially you provide background knowledge, positive examples and negative examples, and it spits out a logic program. It's where the frontier of symbolic AI has sat for a hot second now.