How gkavinrajancodes/pulsedb works
PulseDB combines Redis-compatible in-memory storage and an HNSW vector engine behind RESP2 TCP and an HTTP command gateway. Its main workflow is client request → protocol/API entry point → command execution → KV, data-type, pub/sub, or vector operation, with persistence maintaining state. The graph also preserves documented cluster routing, LangChain retrieval, security, and observability. Edges are limited to relationships shown in excerpts or documented in the README; unsampled subsystems are included where documented, but their internal wiring is not inferred.
Main entry points: commands.py Command Executor · tcp_server.py RESP2 TCP Server · main.py HTTP Gateway · sleep_engine.py Memory Consolidation
Components 21
Client Interfaces
- Python SDK
sdk/pulsedb/client.py - Async SDK
sdk/pulsedb/async_client.py - LangChain Store
sdk/langchain_pulsedb/vectorstore.py
Server Entry Points
- HTTP Gateway
server/main.py - RESP2 TCP Server
server/tcp_server.py - RESP Encoder
server/resp.py - Binary Protocol
server/protocol.py
Command Processing
- Command Executor
server/commands.py - Cluster Routing
server/cluster.py
Data Engines
- Sharded KV Store
server/store.py - Lists and Hashes
server/data_types.py - HNSW Vector Engine
server/vector.py - Pub/Sub
server/pubsub.py - Memory Consolidation
server/sleep_engine.py
Operations
- WAL and Snapshots
server/persistence.py - TTL Sweeper
server/ttl.py - Server Configuration
server/config.py - Health and Metrics
server/main.py
Other components
- Application / Client
- Redis-compatible Client
- OpenAI API
Connections 28
- Application / Client → Python SDK: uses
README.md - Application / Client → Async SDK: uses
README.md - Application / Client → LangChain Store: ingests and searches
README.md - Python SDK → Async SDK: delegates
sdk/pulsedb/client.py - Async SDK → RESP2 TCP Server: sends commands
README.md - LangChain Store → Python SDK: uses SDK
README.md - Redis-compatible Client → RESP2 TCP Server: sends RESP2
README.md - Application / Client → HTTP Gateway: sends HTTP commands
README.md - HTTP Gateway → Command Executor: executes commands
server/main.py - RESP2 TCP Server → RESP Encoder: encodes RESP
server/tcp_server.py - RESP2 TCP Server → Binary Protocol: decodes binary protocol
server/tcp_server.py - RESP2 TCP Server → Command Executor: dispatches commands
server/tcp_server.py - Command Executor → Sharded KV Store: reads and writes
server/commands.py - Command Executor → Lists and Hashes: dispatches type commands
server/commands.py - Command Executor → HNSW Vector Engine: dispatches vector commands
server/commands.py - Command Executor → Pub/Sub: publishes messages
server/commands.py - Command Executor → WAL and Snapshots: logs writes
server/commands.py - Command Executor → Cluster Routing: routes commands
server/commands.py - Command Executor → Memory Consolidation: runs consolidation
server/commands.py - TTL Sweeper → Sharded KV Store: expires keys
server/ttl.py - HTTP Gateway → Pub/Sub: streams subscriptions
server/main.py - WAL and Snapshots → Sharded KV Store: recovers and snapshots
server/persistence.py - HNSW Vector Engine → WAL and Snapshots: saves graph snapshots
README.md - RESP2 TCP Server → Server Configuration: loads auth and TLS settings
server/tcp_server.py - HTTP Gateway → Server Configuration: checks API key
README.md - HTTP Gateway → Health and Metrics: exposes health and metrics
README.md - Memory Consolidation → HNSW Vector Engine: consolidates memories
server/sleep_engine.py - Memory Consolidation → OpenAI API: summarizes with
server/sleep_engine.py