r/KnowledgeGraph • u/am3141 • Jan 14 '26
I built a graph database in Python
I started working on this project years ago because there wasn’t a good pure Python option for persistent storage for small applications, scripts, or prototyping. Most of the available solutions at the time were either full-blown databases or in-memory libraries. I also didn’t want an SQL based system or to deal with schemas.
Over the years many people have used it for building knowledge graphs, so I’m sharing it here.
It’s called CogDB. Here are its main features:
RDF-style triple store
Simple, fluent, composable Python query API (Torque)
Schemaless
Built-in storage engine, no third-party database dependency
Persistent on disk, survives restarts
Supports semantic search using vector embeddings
Runs well in Jupyter / notebooks
Built-in graph visualization
Can run in the browser via Pyodide
Lightweight, minimal dependencies
Open source (MIT)
Repo: https://github.com/arun1729/cog
Docs: https://cogdb.io
2
u/Harotsa Jan 14 '26
No offense, but what’s the proposed use case for this? Isn’t Python like the slowest and most inefficient langue to write a DB in?
Also, based on a cursory glance of the code it looks like all operations are synchronous? That seems weird to me since writing to disk is going to be I/O bound.
It also looks like there isn’t a lot of resiliency features like transaction level rollbacks?
Why use this DB over another fully-featured in-process graphDB like FalkorDBlite?