Skip to main content

Core engine: FSRS scheduling + Knowledge Graph + Spreading Activation

Project description

spikuit-core

PyPI Python versions License

Core engine + lightweight RAG client for Spikuit — a knowledge base that gets smarter the more you use it.

⚠️ Pre-1.0 / under active development. Expect frequent breaking changes until v1.0.0.

spikuit-core ships in two profiles:

Install Pulls in Use case
pip install spikuit-core httpx, numpy Read-only RAG client over an exported brain.db bundle
pip install spikuit-core[engine] + fsrs, networkx, aiosqlite, sqlite-vec, msgspec Full Brain engine: FSRS scheduling, knowledge graph, spreading activation, STDP

The minimal install is what you deploy to a server — the heavy engine deps stay on the authoring machine.

Quick start (RAG client)

Author a brain locally with the full engine (or via the spkt CLI from spikuit-cli), export it once, then retrieve from anywhere with just spikuit-core:

import asyncio
import os

from spikuit_core import QABot

os.environ["SPIKUIT_EMBEDDER_BASE_URL"] = "http://localhost:1234/v1"

brain = QABot.load("brain.db")

async def main() -> None:
    hits = await brain.retrieve("What is a monad?", limit=5, domain="math")
    for h in hits:
        print(f"{h.score:.3f}  {h.content[:80]}")

asyncio.run(main())

QABot.load resolves the embedder endpoint in this order:

  1. SPIKUIT_EMBEDDER_BASE_URL / SPIKUIT_EMBEDDER_API_KEY env vars
  2. base_url= / api_key= keyword arguments
  3. The hint stored in the bundle

If the bundle was exported with provider="none", QABot runs in keyword-only mode and never calls an embedding API.

Quick start (full engine)

import asyncio
from spikuit_core import Circuit, Neuron

async def main() -> None:
    c = Circuit(db_path="brain.db")
    await c.connect()
    await c.add_neuron(
        Neuron.create("---\ntype: concept\ndomain: math\n---\n# Monad\n\n型の文脈化を表す抽象")
    )
    await c.close()

asyncio.run(main())

Engine symbols (Circuit, Neuron, Session, etc.) are loaded lazily via PEP 562 __getattr__ — importing them without the [engine] extras raises a friendly ImportError pointing at the install command.

Links

License

Apache-2.0

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

spikuit_core-0.7.1.tar.gz (96.2 kB view details)

Uploaded Source

Built Distribution

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

spikuit_core-0.7.1-py3-none-any.whl (66.0 kB view details)

Uploaded Python 3

File details

Details for the file spikuit_core-0.7.1.tar.gz.

File metadata

  • Download URL: spikuit_core-0.7.1.tar.gz
  • Upload date:
  • Size: 96.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spikuit_core-0.7.1.tar.gz
Algorithm Hash digest
SHA256 5c15c6b1ea97d7fe5b78df70c8e59b827cd424670e0eff32210fc0157b2266ac
MD5 6e61c583f72752e837e9624feb0b2a5a
BLAKE2b-256 ecf4bf5c06f8ddbf2aa2d98d62bb5d1029145d96123d95f7570f8d599d0029ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for spikuit_core-0.7.1.tar.gz:

Publisher: publish.yml on takyone/spikuit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spikuit_core-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: spikuit_core-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 66.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spikuit_core-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f6f9deab27ff0f95a690e3de85d957d109dc66e85291b92ecdb30616cd928fe
MD5 646575ac29c9f05bd26290ecd62ba69f
BLAKE2b-256 a85ea5613fc8dcaf4cb501ee8de13fdaa8a0695870a0f5b6694683a8a63b0c9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spikuit_core-0.7.1-py3-none-any.whl:

Publisher: publish.yml on takyone/spikuit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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