arun1729/cog
Embedded Graph Database for Python. Lives inside your Python process. Quick setup. No server. Runs in notebooks, apps, even your browser.
What it solves
CogDB provides a persistent, embedded graph database that runs directly within a Python process. It eliminates the need for external server setup, allowing developers to store and query complex relational data (triples) and vector embeddings without the overhead of managing a separate database instance.
How it works
CogDB is a triple store that models data as Node → Edge → Node. It uses a custom graph traversal language called Torque, which is a fluent, chainable Python API that allows users to write queries as native Python code rather than using separate query strings. The database can be used locally in notebooks or apps, or served over HTTP to be accessed by other processes. It also integrates SIMD-optimized similarity search via SimSIMD for handling word embeddings.
Who it’s for
It is designed for Python developers who need a lightweight graph database for interactive environments (like Jupyter notebooks), rapid prototyping, or applications where a serverless, embedded database is preferred.
Highlights
- Serverless Architecture: Runs inside the Python process with no external server required.
- Torque Query Language: A chainable Python API for graph traversals, avoiding context switching between Python and query languages.
- Vector Support: Built-in support for word embeddings (GloVe, Gensim) with k-nearest neighbor and cosine similarity search.
- Flexible Data Loading: Supports importing data from CSV, N-Triples (RDF), and edgelist files, as well as JSON inserts.
- Visualization: Includes built-in
show()andview()methods to visualize graphs interactively in browsers or notebooks.
Related
- Project
- Project
- Project
- Project
- Dispatch