Quick Start
This guide will get you up and running with KnowledgeFlowDB in 5 minutes.
1. Start the Interactive CLI
cargo run -p kfdb
You'll see:
__ __ _____ ____ ____
| |/ /| ___|| _ \| _ \
| \| |__ | | | | | | |
| < \| __| | | | | | | |
|_|\_\_|_| |_|_| |___|_|
KnowledgeFlowDB v1.0.0
Type '.help' for commands
kfdb>
2. View Example Data
The CLI comes pre-populated with example data. List all files:
MATCH (f:File) RETURN f.path, f.size
Output:
┌──────────────┬──────────┐
│ f.path │ f.size │
├──────────────┼──────────┤
│ src/main.rs │ 1500 │
│ src/lib.rs │ 2500 │
└──────────────┴──────────┘
3. Traverse Relationships
Find all functions defined in files:
MATCH (f:File)-[r:DEFINES]->(fn:Function)
RETURN f.path, fn.name, fn.visibility
4. Filter with WHERE
Find only public functions:
MATCH (fn:Function)
WHERE fn.visibility = 'public'
RETURN fn.name
ORDER BY fn.name
5. Run Direct Queries
You can also run queries directly from the command line:
cargo run -p kfdb -- query "MATCH (f:File) RETURN f"
6. Choose Storage Backend
Memory (Default, Fastest)
cargo run -p kfdb -- --storage memory
RocksDB (Persistent, Local)
cargo run -p kfdb -- --storage rocksdb
ScyllaDB (Distributed, Production)
First, start ScyllaDB:
docker-compose up -d
Then connect:
cargo run -p kfdb -- --storage scylla --scylla-nodes "127.0.0.1:9042"
Next Steps
- CLI Reference - Learn all CLI commands
- KQL Syntax - Master the query language
- Architecture - Understand how it works
- Deployment - Deploy to production