Modular NLP primitives for Knotaru — Embedding, Indexing, Chat, Memory
Project description
knotaru-nlp
Modular NLP primitives for Knotaru. Each module is independently installable and built around abstract base classes so implementations can be swapped without changing application code.
Modules
| Module | Purpose | Extra |
|---|---|---|
embedding |
Convert text → dense vectors | [embedding] |
indexing |
Store and query vectors | [indexing] |
chat |
LLM completions | [chat] |
Installation
# All modules
pip install "knotaru-nlp[all]"
# Individual modules
pip install "knotaru-nlp[embedding]"
pip install "knotaru-nlp[indexing]"
pip install "knotaru-nlp[chat]"
Quick Start
from knotaru_nlp.embedding import OpenAIEmbedder
from knotaru_nlp.indexing import MilvusIndex
from knotaru_nlp.chat import OpenAIChat
# Embedding
embedder = OpenAIEmbedder(api_key="sk-...")
vectors = await embedder.embed(["Hello world", "Knotaru rocks"])
# Indexing (Milvus test)
index = MilvusIndex(dim=1536)
await index.upsert([{"id": "1", "vector": vectors[0], "text": "Hello world"}])
results = await index.search(vectors[0], top_k=5)
# Chat
chat = OpenAIChat(api_key="sk-...")
response = await chat.complete([{"role": "user", "content": "Hello!"}])
Design Principles
- Abstract-first: Every module exports an abstract base class. Swap implementations by changing one line.
- Async-native: All I/O methods are
async. - Zero mandatory deps: Core package installs with no heavy dependencies. Add only what you use via extras.
- Typed: Full
mypy --strictcompliance.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
knotaru_nlp-0.1.2.tar.gz
(49.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file knotaru_nlp-0.1.2.tar.gz.
File metadata
- Download URL: knotaru_nlp-0.1.2.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cd013f619c24b6baad2c50a176de7f365f027e1f3a76603e6f1564943644133
|
|
| MD5 |
b8947ee4036cbb6ea83fe249e7d55dd6
|
|
| BLAKE2b-256 |
f11be842f09969dd61d3b7d053fc263b31689095ec14bac6871f6a84ee9632c9
|
File details
Details for the file knotaru_nlp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: knotaru_nlp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 64.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679e1e149979cdac9d8449f4de295d40f83bfd441ff79e9ec51515e27c95fe1f
|
|
| MD5 |
181df1a15937e2d0001a195f6963339c
|
|
| BLAKE2b-256 |
27055891e3a42d037a28c09a236d2575097c475b649eec7ddd78a6262edd7eec
|