Skip to main content

vruksha

vruksha turns a litesearch store into a typed knowledge graph. It extracts entities and typed relations from each chunk with a model you pass in, primes the model with the entities already in the graph so it reuses them, merges the duplicates that slip through behind a lexical guard, and searches by walking refers_to/cites/builds_on edges fused with hybrid.

It is model-agnostic: you inject chat (any object with .oneshot(prompt, sp=, max_tokens=)) and emb_fn. rishi, urai, an API client, anything. vruksha names no model and owns litesearch’s entity/mention/edge tables.

from litesearch import database
from vruksha import build_graph          # extract + prime + write + embed + merge, incremental

db = database('corpus.db')               # a litesearch store with a tree
build_graph(db, chat=my_chat, emb_fn=my_encoder)   # a local model does the extraction
db.graph_search('how does resolution work', qemb)  # hybrid + a typed-edge walk

The lexical guard

Priming stops most duplicates; resolve_entities merges the rest. Embedding similarity alone merges python 3.11 into python 3.12, so every merge passes _lex_ok first: token overlap or a matching acronym, and identical numbers.

from vruksha.entities import _lex_ok
_lex_ok('multi-head attention', 'multi head attention'), _lex_ok('python 3.11', 'python 3.12')

A per-corpus citation seed

The model catches loose references. Structured ones (an EU directive’s Article 5, Annex III) are cheaper caught by a regex, so a legal corpus can pass seed_fn=cites, canon=norm_cite. It is optional and off by default: nothing but a citation-dense corpus needs it.

What it is worth

On cross-reference bridges (the query shares no word with the answer), the typed leg reaches the target 0.61 to 0.87 of the time against 0.08 to 0.20 for hybrid, tracking the extractor: a local Qwen3-4B matches a frontier model, a 1.5B needs the seed. The PMI co-occurrence graph this package used to build reached none of them; the method and numbers are in litesearch evals/RESULTS.md.

Install

pip install vruksha

Metadata

Release files for vruksha 0.1.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 vruksha 0.1.0
File Size Uploaded
vruksha-0.1.0.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vruksha 0.1.0
File Interpreter ABI Platform
vruksha-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / vruksha-0.1.0.tar.gz

Download URL vruksha-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8ab8b9d106cb7f121a785a60a9a48ae09e224cfc64bcf6a7b932e0aa163d4365
BLAKE2b-256 checksum
How to use checksums
74ff0cd78c1db3971853e4016edf4b07a3f430376cd01290a4ffd08f6d2910e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / vruksha-0.1.0-py3-none-any.whl

Download URL vruksha-0.1.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebea6a47469e20ad23ed5249b0b5126a314d632ae2175aac9f9afa2a466289a3
BLAKE2b-256 checksum
How to use checksums
f830d395089498ab6188e2dbb094371898cdcb0d40a14b58e647f0085c01898f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.2

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