Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FalkorDB/falkordb
A super fast Graph Database uses GraphBLAS under the hood for its sparse adjacency matrix graph representation. Our goal is to provide the best Knowledge Graph for LLM (GraphRAG).
https://github.com/FalkorDB/falkordb
cloud-database database database-as-a-service developer-tools devtools graph-database graphrag knowledge-graph realtime-database
Last synced: 4 days ago
JSON representation
A super fast Graph Database uses GraphBLAS under the hood for its sparse adjacency matrix graph representation. Our goal is to provide the best Knowledge Graph for LLM (GraphRAG).
- Host: GitHub
- URL: https://github.com/FalkorDB/falkordb
- Owner: FalkorDB
- License: other
- Created: 2023-07-20T10:47:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-05T14:32:11.000Z (10 days ago)
- Last Synced: 2025-01-05T15:34:20.122Z (10 days ago)
- Topics: cloud-database, database, database-as-a-service, developer-tools, devtools, graph-database, graphrag, knowledge-graph, realtime-database
- Language: C
- Homepage: https://www.falkordb.com/
- Size: 97.3 MB
- Stars: 819
- Watchers: 21
- Forks: 39
- Open Issues: 369
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Security: SECURITY.md
Awesome Lists containing this project
- StarryDivineSky - FalkorDB/falkordb
README
[![Dockerhub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/)
[![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/6M4QwDXn2w)
[![Workflow](https://github.com/FalkorDB/FalkorDB/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/FalkorDB/FalkorDB/actions/workflows/build.yml)# FalkorDB
[![Try Free](https://img.shields.io/badge/Try%20Free-FalkorDB%20Cloud-FF8101?labelColor=FDE900&style=for-the-badge&link=https://app.falkordb.cloud)](https://app.falkordb.cloud)**Our objective is to create an outstanding Knowledge Graph specifically for Large Language Models (LLM) that boasts exceptionally low latency, ensuring swift delivery of information through our Graph Database, known as KG-RAG.**
[FalkorDB](https://www.falkordb.com) is the first queryable [Property Graph](https://github.com/opencypher/openCypher/blob/master/docs/property-graph-model.adoc) database to use [sparse matrices](https://en.wikipedia.org/wiki/Sparse_matrix) to represent the [adjacency matrix](https://en.wikipedia.org/wiki/Adjacency_matrix) in graphs and [linear algebra](http://faculty.cse.tamu.edu/davis/GraphBLAS.html) to query the graph.
Primary features:
* Adopting the [Property Graph Model](https://github.com/opencypher/openCypher/blob/master/docs/property-graph-model.adoc)
* Nodes (vertices) and Relationships (edges) that may have attributes
* Nodes can have multiple labels
* Relationships have a relationship type
* Graphs represented as sparse adjacency matrices
* [OpenCypher](http://www.opencypher.org/) with proprietary extensions as a query language
* Queries are translated into linear algebra expressionsTo see FalkorDB in action, visit [Demos](https://github.com/FalkorDB/FalkorDB/tree/master/demo).
## Quickstart
1. [Trying FalkorDB](#give-it-a-try)
2. [Build](#building)
3. [Start](#loading-falkordb-into-redis)
4. [Use from any client](#using-falkordb)
5. [Documentation](https://docs.falkordb.com/)## Give it a try
To quickly try out FalkorDB, launch an instance using docker:
```
docker run -p 6379:6379 -it --rm -v ./data:/data falkordb/falkordb:edge
```Or, to use the built-in browser-based interface, run:
```
docker run -p 6379:6379 -p 3000:3000 -it --rm -v ./data:/data falkordb/falkordb:edge
```Then, open your browser and navigate to `http://localhost:3000`.
You can also interact with FalkorDB using any of the supported [client libraries](#Client-libraries)
Here we'll use [FalkorDB Python client](https://pypi.org/project/FalkorDB/) to create a small graph representing a subset of motorcycle riders and teams taking part in the MotoGP league, once created we'll start querying our data.
```python
from falkordb import FalkorDB# Connect to FalkorDB
db = FalkorDB(host='localhost', port=6379)# Create the 'MotoGP' graph
g = db.select_graph('MotoGP')
g.query("""CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
(:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),
(:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})""")# Query which riders represents Yamaha?
res = g.query("""MATCH (r:Rider)-[:rides]->(t:Team)
WHERE t.name = 'Yamaha'
RETURN r.name""")for row in res.result_set:
print(row[0])# Prints: "Valentino Rossi"
# Query how many riders represent team Ducati ?
res = g.query("""MATCH (r:Rider)-[:rides]->(t:Team {name:'Ducati'})
RETURN count(r)""")print(res.result_set[0][0])
# Prints: 1
```## Building
### Compiling
Requirements:
* The FalkorDB repository: `git clone --recurse-submodules -j8 https://github.com/FalkorDB/FalkorDB.git`
* On Ubuntu Linux, run: `apt-get install build-essential cmake m4 automake peg libtool autoconf python3 python3-pip`
* On OS X, verify that `homebrew` is installed and run: `brew install cmake m4 automake peg libtool autoconf`.
* The version of Clang that ships with the OS X toolchain does not support OpenMP, which is a requirement for FalkorDB. One way to resolve this is to run `brew install gcc g++` and follow the on-screen instructions to update the symbolic links. Note that this is a system-wide change - setting the environment variables for `CC` and `CXX` will work if that is not an option.To build, run `make` in the project's directory.
Congratulations! You can find the compiled binary at `bin//src/falkordb.so`.
### Running tests
First, install required Python packages by running ```pip install -r requirements.txt``` from the ```tests``` directory.
If you've got ```redis-server``` in PATH, just invoke ```make test```.
Otherwise, invoke ```REDIS_SERVER= make test```.
For more verbose output, run ```make test V=1```.
### Building in a docker
The FalkorDB build system runs within docker. For detailed instructions on building, please [see here](docs/docker-examples/README.md).
## Loading FalkorDB into Redis
FalkorDB is hosted by [Redis](https://redis.io), so you'll first have to load it as a Module to a Redis server. [Redis 6.2](https://redis.io/download) is required for FalkorDB 2.12.
We recommend having Redis load FalkorDB during startup by adding the following to your redis.conf file:
```
loadmodule /path/to/module/src/falkordb.so
```In the line above, replace `/path/to/module/src/falkordb.so` with the actual path to FalkorDB's library.
If Redis is running as a service, you must ensure that the `redis` user (default) has the necessary file/folder permissions
to access `falkordb.so`.Alternatively, you can have Redis load FalkorDB using the following command line argument syntax:
```sh
~/$ redis-server --loadmodule /path/to/module/src/falkordb.so
```Lastly, you can also use the [`MODULE LOAD`](http://redis.io/commands/module-load) command. Note, however, that `MODULE LOAD` is a dangerous command and may be blocked/deprecated in the future due to security considerations.
Once you've successfully loaded FalkorDB your Redis log should see lines similar to:
```
...
30707:M 20 Jun 02:08:12.314 * Module 'graph' loaded from /src/falkordb.so
...
```If the server fails to launch with output similar to:
```
# Module /usr/lib/redis/modules/falkordb.so failed to load: libgomp.so.1: cannot open shared object file: No such file or directory
# Can't load module from /usr/lib/redis/modules/falkordb.so: server aborting
```The system is missing the run-time dependency OpenMP. This can be installed on Ubuntu with `apt-get install libgomp1`, on RHEL/CentOS with `yum install libgomp`, and on OSX with `brew install libomp`.
## Using FalkorDB
You can call FalkorDB's commands from any Redis client.
### With `redis-cli`
```sh
$ redis-cli
127.0.0.1:6379> GRAPH.QUERY social "CREATE (:person {name: 'roi', age: 33, gender: 'male', status: 'married'})"
```### With any other client
You can interact with FalkorDB using your client's ability to send raw Redis commands.
Depending on your client of choice, the exact method for doing that may vary.
#### Python example
This code snippet shows how to use FalkorDB with from Python using [falkordb-py](https://github.com/FalkorDB/falkordb-py):
```Python
from falkordb import FalkorDB# Connect to FalkorDB
db = FalkorDB(host='localhost', port=6379)# Select the social graph
g = db.select_graph('social')reply = g.query("CREATE (:person {name:'roi', age:33, gender:'male', status:'married'})")
```### Client libraries
Some languages have client libraries that provide support for FalkorDB's commands:
| Project | Language | License | Author | Stars | Package | Comment |
| --------------------------------------------------------- | ---------- | ------- | ------------------------------------------- | ----------------------------------------------------------------- | ------- | ---------- |
| [jfalkordb][jfalkordb-url] | Java | BSD | [FalkorDB][falkordb-url] | ![Stars][jfalkordb-stars] | [Maven][jfalkordb-package]||
| [falkordb-py][falkordb-py-url] | Python | MIT | [FalkorDB][falkordb-url] | ![Stars][falkordb-py-stars] | [pypi][falkordb-py-package]||
| [falkordb-ts][falkordb-ts-url] | Node.JS | MIT | [FalkorDB][falkordb-url] | ![Stars][falkordb-ts-stars] | [npm][falkordb-ts-package]||
| [nredisstack][nredisstack-url] | .NET | MIT | [Redis][redis-url] | ![Stars][nredisstack-stars] | [nuget][nredisstack-package]||
| [redisgraph-rb][redisgraph-rb-url] | Ruby | BSD | [Redis][redisgraph-rb-author] | [![redisgraph-rb-stars]][redisgraph-rb-url] | [GitHub][redisgraph-rb-url] ||
| [redgraph][redgraph-url] | Ruby | MIT | [pzac][redgraph-author] | [![redgraph-stars]][redgraph-url] | [GitHub][redgraph-url] ||
| [redisgraph-go][redisgraph-go-url] | Go | BSD | [Redis][redisgraph-go-author] | [![redisgraph-go-stars]][redisgraph-go-url] | [GitHub][redisgraph-go-url]||
| [rueidis][rueidis-url] | Go | Apache 2.0 | [Rueian][rueidis-author] | [![rueidis-stars]][rueidis-url] | [GitHub][rueidis-url] ||
| [ioredisgraph][ioredisgraph-url] | JavaScript | ISC | [Jonah][ioredisgraph-author] | [![ioredisgraph-stars]][ioredisgraph-url] | [GitHub][ioredisgraph-url] ||
| [@hydre/rgraph][rgraph-url] | JavaScript | MIT | [Sceat][rgraph-author] | [![rgraph-stars]][rgraph-url] | [GitHub][rgraph-url] ||
| [php-redis-graph][php-redis-graph-url] | PHP | MIT | [KJDev][php-redis-graph-author] | [![php-redis-graph-stars]][php-redis-graph-url] | [GitHub][php-redis-graph-url] ||
| [redisgraph_php][redisgraph_php-url] | PHP | MIT | [jpbourbon][redisgraph_php-author] | [![redisgraph_php-stars]][redisgraph_php-url] | [GitHub][redisgraph_php-url] ||
| [redisgraph-ex][redisgraph-ex-url] | Elixir | MIT | [crflynn][redisgraph-ex-author] | [![redisgraph-ex-stars]][redisgraph-ex-url] | [GitHub][redisgraph-ex-url] ||
| [redisgraph-rs][redisgraph-rs-url] | Rust | MIT | [malte-v][redisgraph-rs-author] | [![redisgraph-rs-stars]][redisgraph-rs-url] | [GitHub][redisgraph-rs-url] ||
| [redis_graph][redis_graph-url] | Rust | BSD | [tompro][redis_graph-author] | [![redis_graph-stars]][redis_graph-url] | [GitHub][redis_graph-url] ||
| [rustis][rustis-url] | Rust | MIT | [Dahomey Technologies][rustis-author] | [![rustis-stars]][rustis-url] | [Crate](https://crates.io/crates/rustis) | [Documentation](https://docs.rs/rustis/latest/rustis/commands/trait.GraphCommands.html) |
| [NRedisGraph][NRedisGraph-url] | C# | BSD | [tombatron][NRedisGraph-author] | [![NRedisGraph-stars]][NRedisGraph-url] | [GitHub][NRedisGraph-url] ||
| [RedisGraph.jl][RedisGraph.jl-url] | Julia | MIT | [xyxel][RedisGraph.jl-author] | [![RedisGraph.jl-stars]][RedisGraph.jl-url] | [GitHub][RedisGraph.jl-url] ||[redis-url]: https://redis.com
[falkordb-url]: https://www.falkordb.com[falkordb-py-url]: http://github.com/falkorDB/falkordb-py
[falkordb-py-stars]: https://img.shields.io/github/stars/falkorDB/falkordb-py.svg?style=social&label=Star&maxAge=2592000
[falkordb-py-package]: https://pypi.org/project/FalkorDB[jfalkordb-url]: https://github.com/falkordb/jfalkordb
[jfalkordb-stars]: https://img.shields.io/github/stars/falkordb/jfalkordb.svg?style=social&label=Star&maxAge=2592000
[jfalkordb-package]: https://search.maven.org/artifact/com.falkordb/jfalkordb[nredisstack-url]: https://github.com/redis/nredisstack
[nredisstack-stars]: https://img.shields.io/github/stars/redis/nredisstack.svg?style=social&label=Star&maxAge=2592000
[nredisstack-package]: https://www.nuget.org/packages/nredisstack/[falkordb-ts-url]: https://github.com/falkordb/falkordb-ts
[falkordb-ts-stars]: https://img.shields.io/github/stars/falkordb/falkordb-ts.svg?style=social&label=Star&maxAge=2592000
[falkordb-ts-package]: https://www.npmjs.com/package/falkordb[redisgraph-rb-author]: https://redislabs.com
[redisgraph-rb-url]: https://github.com/RedisGraph/redisgraph-rb
[redisgraph-rb-stars]: https://img.shields.io/github/stars/RedisGraph/redisgraph-rb.svg?style=social&label=Star&maxAge=2592000[redgraph-author]: https://github.com/pzac
[redgraph-url]: https://github.com/pzac/redgraph
[redgraph-stars]: https://img.shields.io/github/stars/pzac/redgraph.svg?style=social&label=Star&maxAge=2592000[redisgraph-go-author]: https://redislabs.com
[redisgraph-go-url]: https://github.com/RedisGraph/redisgraph-go
[redisgraph-go-stars]: https://img.shields.io/github/stars/RedisGraph/redisgraph-go.svg?style=social&label=Star&maxAge=2592000[rueidis-url]: https://github.com/rueian/rueidis
[rueidis-author]: https://github.com/rueian
[rueidis-stars]: https://img.shields.io/github/stars/rueian/rueidis.svg?style=social&label=Star&maxAge=2592000[rgraph-author]: https://github.com/Sceat
[rgraph-url]: https://github.com/HydreIO/rgraph
[rgraph-stars]: https://img.shields.io/github/stars/HydreIO/rgraph.svg?style=social&label=Star&maxAge=2592000[ioredisgraph-author]: https://github.com/Jonahss
[ioredisgraph-url]: https://github.com/Jonahss/ioredisgraph
[ioredisgraph-stars]: https://img.shields.io/github/stars/Jonahss/ioredisgraph.svg?style=social&label=Star&maxAge=2592000[php-redis-graph-author]: https://github.com/kjdev
[php-redis-graph-url]: https://github.com/kjdev/php-redis-graph
[php-redis-graph-stars]: https://img.shields.io/github/stars/kjdev/php-redis-graph.svg?style=social&label=Star&maxAge=2592000[redisgraph_php-author]: https://github.com/jpbourbon
[redisgraph_php-url]: https://github.com/jpbourbon/redisgraph_php
[redisgraph_php-stars]: https://img.shields.io/github/stars/jpbourbon/redisgraph_php.svg?style=social&label=Star&maxAge=2592000[redislabs-redisgraph-php-author]: https://github.com/mkorkmaz
[redislabs-redisgraph-php-url]: https://github.com/mkorkmaz/redislabs-redisgraph-php
[redislabs-redisgraph-php-stars]: https://img.shields.io/github/stars/mkorkmaz/redislabs-redisgraph-php.svg?style=social&label=Star&maxAge=2592000[redisgraph-ex-author]: https://github.com/crflynn
[redisgraph-ex-url]: https://github.com/crflynn/redisgraph-ex
[redisgraph-ex-stars]: https://img.shields.io/github/stars/crflynn/redisgraph-ex.svg?style=social&label=Star&maxAge=2592000[redisgraph-rs-author]: https://github.com/malte-v
[redisgraph-rs-url]: https://github.com/malte-v/redisgraph-rs
[redisgraph-rs-stars]: https://img.shields.io/github/stars/malte-v/redisgraph-rs.svg?style=social&label=Star&maxAge=2592000[redis_graph-author]: https://github.com/tompro
[redis_graph-url]: https://github.com/tompro/redis_graph
[redis_graph-stars]: https://img.shields.io/github/stars/tompro/redis_graph.svg?style=social&label=Star&maxAge=2592000[NRedisGraph-author]: https://github.com/tombatron
[NRedisGraph-url]: https://github.com/tombatron/NRedisGraph
[NRedisGraph-stars]: https://img.shields.io/github/stars/tombatron/NRedisGraph.svg?style=social&label=Star&maxAge=2592000[RedisGraphDotNet.Client-author]: https://github.com/Sgawrys
[RedisGraphDotNet.Client-url]: https://github.com/Sgawrys/RedisGraphDotNet.Client
[RedisGraphDotNet.Client-stars]: https://img.shields.io/github/stars/Sgawrys/RedisGraphDotNet.Client.svg?style=social&label=Star&maxAge=2592000[RedisGraph.jl-author]: https://github.com/xyxel
[RedisGraph.jl-url]: https://github.com/xyxel/RedisGraph.jl
[RedisGraph.jl-stars]: https://img.shields.io/github/stars/xyxel/RedisGraph.jl.svg?style=social&label=Star&maxAge=2592000[rustis-url]: https://github.com/dahomey-technologies/rustis
[rustis-author]: https://github.com/dahomey-technologies
[rustis-stars]: https://img.shields.io/github/stars/dahomey-technologies/rustis.svg?style=social&label=Star&maxAge=2592000## License
Licensed under the Server Side Public License v1 (SSPLv1). See [LICENSE](LICENSE.txt).