Metadata-Version: 2.1
Name: vernkv
Version: 1.0.0
Summary: Zero-dependency Python SDK & high-speed local vector RAG database powered by VernKV
License: Apache-2.0
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Description-Content-Type: text/markdown

# *VernKV*

[![Go Reference](https://pkg.go.dev/badge/github.com/ver1619/VERN_KV.svg?style=flat-square)](https://pkg.go.dev/github.com/ver1619/VERN_KV)
![Go Version](https://img.shields.io/badge/Go-1.25%2B-1f2937?logo=go&logoColor=00ADD8&style=flat-square)
![PyPI Package](https://img.shields.io/badge/PyPI-vernkv%20v1.0.0-3775A9?logo=pypi&logoColor=white&style=flat-square)
[![Documentation](https://img.shields.io/badge/Documentation-notes%2Findex.md-2563eb?style=flat-square&logo=readthedocs&logoColor=white)](notes/index.md)
![Platforms](https://img.shields.io/badge/Platforms-Linux%20%7C%20Windows-0f766e?style=flat-square)
[![License](https://img.shields.io/badge/License-Apache%202.0-eab308?style=flat-square)](LICENSE)

<p align="center">
  <img 
    src="./logo.jpg"
    alt="VernKV logo"
    width="300"
  >
</p>

An embeddable, pure-Go **LSM-Tree Key-Value & Vector Search Database** for **Linux and Windows**, with a CLI, HTTP/RESP2 server, and Python AI SDK (`vernkv`).

---

## Architecture

<div align="center">

```mermaid
flowchart TD
    Clients["Clients (Python vernkv / CLI / HTTP REST / RESP2 / Go)"]
    Server["Network Server (server/) & CLI (cmd/)"]
    Engine["Core Engine (engine/) + Cross-Process LOCK + kv_vault"]
    WAL["WAL Group Commit (wal/)"]
    Mem["Memtable SkipList (memtable/)"]
    Vec["Pure-Go Vector Index: Flat & HNSW (vector/)"]
    SST["SSTables L0..L6 + Bloom Filters & Codecs (sstable/)"]
    Man["Atomic MANIFEST (manifest/)"]

    Clients --> Server
    Server --> Engine
    Server --> Vec
    Engine --> WAL --> Mem
    Vec -.->|"Atomic WriteBatch (_vec:, _vmeta:, _vdoc:)"| Engine
    Mem -->|"Flush & Compaction"| SST --> Man
```

</div>

---

## Quick Setup

> [!IMPORTANT]
> **Windows Users:** Our documentation and walkthrough commands use Linux/POSIX Bash syntax. Please run them inside **Git Bash** (included with [Git for Windows](https://gitforwindows.org/)).

- **Python (`pip` / `uv` — zero external deps, bundles server binary):**

```bash
pip install vernkv / uv add vernkv
```

- **Go (`v1.0.0` binaries or library import):**

```bash
go install github.com/ver1619/VERN_KV/cmd/vernkv-server@v1.0.0
go get github.com/ver1619/VERN_KV@v1.0.0
```

- **From GitHub Source:**

```bash
git clone https://github.com/ver1619/VERN_KV.git && cd VERN_KV
make build && make test
```

See [notes/vern/getting_started.md](notes/vern/getting_started.md) and [notes/vern/python_sdk.md](notes/vern/python_sdk.md) for prebuilt GitHub Release downloads, wheels, and full Windows instructions.

---

## Project Structure

```text
VERN_KV/
├── cmd/           # CLI REPL (vernkv-cli) and network server (vernkv-server)
├── engine/        # LSM-Tree DB, group commit, compaction, LOCK, .config & kv_vault
├── memtable/      # Lock-free-read skip list write buffer
├── wal/           # Checksummed write-ahead log segments & truncation
├── sstable/       # Prefix-compressed data blocks, Bloom filters & compression codecs
├── manifest/      # Atomic MANIFEST journal
├── iter/          # Lazy stream operators & iterators
├── iterators/     # Multi-way merge & MVCC version filter iterators
├── query/         # Cursor bridge, KVStream & DBStats
├── vector/        # Pure-Go Flat & HNSW vector indexes + atomic LSM store
├── server/        # Redis RESP2 TCP & HTTP JSON REST handlers
├── sdk/python/    # Zero-dependency Python SDK (vernkv) & Linux/Windows wheel builder
├── tests/         # Integration, crash-recovery & determinism test suites
└── notes/         # Full architecture, developer, user & hands-on dev-test docs
```

---

## Documentation

Read the complete documentation starting at **[notes/index.md](notes/index.md)**:

| Section | Focus | Entry Point |
|---|---|---|
| **Architecture** | Storage engine, WAL/Memtable/SSTable/Manifest formats, network server, vector engine, iterators & caching | [notes/arch/](notes/index.md#1-system-architecture-notesarch) |
| **End-User & Python SDK** | Linux/Windows setup, Python SDK workflows, `kv_vault` credentials & `.config`, CLI reference, server & vector APIs | [notes/vern/](notes/index.md#3-end-user--python-sdk-guides-notesvern) |
| **Developer & Benchmarks** | Contributor workflow, `Makefile` & CI/CD releases, test matrix, and reproducible hardware benchmarks | [notes/developer/](notes/index.md#2-developer--benchmark-guides-notesdeveloper) |
| **Hands-On Walkthroughs** | Isolated sandbox CLI/server tests and dedicated `uv` Python AI test project | [notes/dev-test/vern.md](notes/dev-test/vern.md) · [notes/dev-test/vern_ai.md](notes/dev-test/vern_ai.md) |

---

## References

- **[ver1619/itFrame](https://github.com/ver1619/itFrame)** — Composable, lazy iterator framework in Go used for VernKV's stream query pipelines (`iter/` and `query/`).
