Skip to main content

velesdb-common

Shared utilities for VelesDB Python integrations.

This package is not a public API. End users should install and import from langchain-velesdb, llama-index-vector-stores-velesdb, or haystack-velesdb directly.

What it provides

velesdb-common centralizes code shared by all three Python RAG framework integration packages:

  • Security validators — input sanitization for collection names, dimensions, queries, URLs
  • ID generation — deterministic hashing and sequential ID counters
  • Graph helpers — REST payload builders and native graph bindings
  • Memory formatting — procedural memory result formatting

Public Exports

The following symbols form the stable internal API consumed by langchain-velesdb, llama-index-vector-stores-velesdb, and haystack-velesdb. They are not intended for direct use by end users.

Fusion

Export Type Description
build_fusion_strategy function Converts a strategy name + params dict into the native FusionStrategy object

Shared mixins / bases

Export Type Description
CollectionAdminMixin class Mixin providing shared admin operations (create_metadata_collection, is_metadata_only, train_pq, analyze_collection, get_collection_stats)
GraphOpsBase class Base class for graph query helpers used by both integrations

ID helpers

Export Type Description
stable_hash_id function Deterministic 64-bit hash of an input string (used as collection-stable ID). SHA-256 by default; pass algorithm="fnv1a" to align with VelesDB core's/velesdb-migrate's FNV-1a IDs — see KNOWN_LIMITATIONS #12 before switching
make_initial_id_counter function Builds a thread-safe sequential ID counter seeded from existing collection state

Memory helpers

Export Type Description
chronological function Sorts episodic events oldest-first on (timestamp, id)
format_procedural_results function Normalizes raw procedural-memory recall output into a stable result list
parse_event_entry function Parses a JSON event description into (role, content)
resolve_procedure_id function Resolves a procedure name or numeric ID for reinforce()
store_procedure function Inserts a procedural-memory entry with the canonical schema used by both integrations

Security: validators

Export Type Description
SecurityError exception Raised by every validate_* on rejected input
validate_url function Validates a server URL string
validate_text function Sanitizes free-text query strings against injection patterns
validate_query function Validates VelesQL query strings against length / character limits
validate_collection_name function Alphanumeric + underscore, ≤ 64 chars
validate_dimension function Within MIN_DIMENSION..=MAX_DIMENSION
validate_metric function Against ALLOWED_METRICS
validate_storage_mode function Against ALLOWED_STORAGE_MODES / STORAGE_MODE_ALIASES
validate_path function Filesystem path bounds + character rules
validate_k function k value in [1, MAX_K_VALUE]
validate_batch_size function Batch size in [1, MAX_BATCH_SIZE]
validate_timeout function Timeout ms within sane bounds
validate_weight function Fusion weight in [0.0, 1.0]
validate_sparse_vector function Sparse pair list bounds

Security: constants

Export Type Description
ALLOWED_METRICS set Canonical metric strings (cosine, euclidean, dot, …); single-sourced from velesdb.DISTANCE_METRICS, with a literal fallback when the wheel is absent
ALLOWED_STORAGE_MODES set Canonical storage modes (full, sq8, binary, pq, rabitq); single-sourced from velesdb.STORAGE_MODES, with a literal fallback when the wheel is absent
ALLOWED_CONDITION_TYPES set Canonical procedural condition types; single-sourced from velesdb.CONDITION_TYPES, with a literal fallback when the wheel is absent
STORAGE_MODE_ALIASES dict Alias → canonical mapping (e.g. int8sq8)
DEFAULT_TIMEOUT_MS int Default timeout used when callers don't specify one
MIN_DIMENSION / MAX_DIMENSION int Vector dimension bounds
MAX_BATCH_SIZE int Hard cap on per-call batch operations
MAX_K_VALUE int Hard cap on retrieval k
MAX_PATH_LENGTH int Filesystem path length cap
MAX_QUERY_LENGTH int VelesQL query length cap
MAX_SPARSE_VECTOR_SIZE int Sparse vector non-zero entry cap
MAX_TEXT_LENGTH int Free-text query length cap

Graph helpers

Export Type Description
build_graph_rest_payload function Constructs the JSON body for REST-backed graph traversal calls
parse_graph_traverse_response function Decodes a graph traversal REST response into the shared result shape
open_native_graph function Opens (or attaches to) a native-backend graph collection
is_timeout_exception function Cross-backend timeout-error predicate

License

MIT License (this integration). See LICENSE for details.

VelesDB Core itself is licensed under the VelesDB Core License 1.0 (based on ELv2).

Release files for velesdb-common 6.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for velesdb-common 6.0.0
File Size Uploaded
velesdb_common-6.0.0.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for velesdb-common 6.0.0
File Interpreter ABI Platform
velesdb_common-6.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.8 kB

Release files / velesdb_common-6.0.0.tar.gz

Download URL velesdb_common-6.0.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4e763dc3748a3497601a25c8cf8831119548fcdc4a9e45655ea0ea853259f6ae
BLAKE2b-256 checksum
How to use checksums
94b72e3c071690e437c1eadc450ab73832ee7aac83f8f5f1af9c211d79e04500
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / velesdb_common-6.0.0-py3-none-any.whl

Download URL velesdb_common-6.0.0-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42df760217ba5723d39cb9e79049f146b26742449a57c37a060f1369f14a6486
BLAKE2b-256 checksum
How to use checksums
69bba244acd49ebb55ca22dc740e8997e56c16107c9f3c4942c4e7d4e5265754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.2.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.0

2 release files

3.9.1

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.16.0

2 release files

1.15.0

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.8

2 release files

1.13.7

2 release files

1.13.6

2 release files

1.13.3

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page