Skip to main content

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 --strict compliance.

Project details


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.1.tar.gz (37.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

knotaru_nlp-0.1.1-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

Details for the file knotaru_nlp-0.1.1.tar.gz.

File metadata

  • Download URL: knotaru_nlp-0.1.1.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.7 HTTPX/0.28.1

File hashes

Hashes for knotaru_nlp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 69c4aca19e5f6f6080a023beb4aaee8ea807204f9edd1d49daabf315500f2b0b
MD5 4775714764d3f544c33e7edc5cc784a9
BLAKE2b-256 2428ebebd1bd5633c9609dc57dfb47f2b264f508a4281573b730cdb0e728765a

See more details on using hashes here.

File details

Details for the file knotaru_nlp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: knotaru_nlp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.7 HTTPX/0.28.1

File hashes

Hashes for knotaru_nlp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 240daea5f27a6644d1235d1aeefd36d19e9995e738fca65b9d348ac1f0167996
MD5 8a02de56b56352e5681c9f550378605e
BLAKE2b-256 e996e6166fe1bde1ef926dfdf9f70ffbb4e073c846a88b064d63f04d3f5a8f0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page