Skip to main content

Assistant tooling for SENSEI projects.

Project description

Senpai Assistant

Senpai Assistant is a Python package for building and running a SENSEI-focused assistant. It provides a console entry point and a public Python API for host applications that need to create assistants over SENSEI project files, connector files, reference docs, embeddings, and an external conversation checkpointer.

Installation

pip install senpai-assistant

The package requires Python 3.12 or newer.

CLI

After installation, run the assistant with:

senpai-assistant --help

You can also run the module directly:

python -m senpai_assistant --help

Python API

from pathlib import Path

from senpai_assistant import create_assistant_for_paths

assistant = create_assistant_for_paths(
    user_path=Path("/path/to/users/user_1"),
    thread_id="thread-1",
    runtime_root=Path("/var/lib/senpai-assistant"),
    checkpointer=checkpointer,
)

response = assistant.send_message(
    "Create a profile for refund questions",
    active_project="shop_a",
)

checkpointer should be a LangGraph checkpointer provided by the host application. For local CLI-style usage without an external checkpointer, pass require_checkpointer=False to allow the SQLite fallback. active_project is optional per message and may change from one turn to the next. Hosted applications can pass the project currently open in the UI so Senpai uses it as the default target for profile and rule tools for that message. If active_project is omitted, empty, or None, Senpai assumes there is no active project selected for that message and will not reuse a previously active host project.

The public package exports:

  • Assistant
  • create_assistant_for_paths(...)
  • configure_runtime_root(...)
  • get_runtime_root()
  • main

create_assistant_for_paths(...) expects a SENSEI user directory containing connectors/ and projects/. Projects are discovered from user_path / "projects". In hosted deployments, pass an external LangGraph checkpointer so conversation state is not stored in local SQLite.

Runtime Files

Senpai Assistant writes generated runtime artifacts under the configured runtime root. The resolution order is:

  1. An explicit runtime_root argument.
  2. The process-wide root set with configure_runtime_root(...).
  3. The SENPAI_HOME environment variable.
  4. The default user data location for the current platform.

Embedding indexes are stored under that runtime root. Local CLI usage can fall back to SQLite, but application integrations should pass their own checkpointer.

Releases

Releases are published from tags named vX.Y.Z. The tag version must match the version in pyproject.toml, and CHANGELOG.md must contain a matching ## [X.Y.Z] section.

uv version 0.1.1
git add pyproject.toml uv.lock CHANGELOG.md
git commit -m "Release 0.1.1"
git tag v0.1.1
git push origin main --tags

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

senpai_assistant-0.6.0.tar.gz (124.9 kB view details)

Uploaded Source

Built Distribution

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

senpai_assistant-0.6.0-py3-none-any.whl (103.2 kB view details)

Uploaded Python 3

File details

Details for the file senpai_assistant-0.6.0.tar.gz.

File metadata

  • Download URL: senpai_assistant-0.6.0.tar.gz
  • Upload date:
  • Size: 124.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for senpai_assistant-0.6.0.tar.gz
Algorithm Hash digest
SHA256 0ceecd5d37ec891ce773ea1800d35eabaf3f28c01b6f0d399d58aa0862124f9c
MD5 d27c07719fc80e17cbc9c26db86952ee
BLAKE2b-256 84bf92c2bafdc533f7a84607d459ddfd8a12de68de6c5f4557998d4e6317b3d1

See more details on using hashes here.

File details

Details for the file senpai_assistant-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: senpai_assistant-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 103.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for senpai_assistant-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29ca8447c10839be8a6d15c3f1d7ded49ed650d30dce58a85a68cd5ea0d0b992
MD5 8d66d8120405f0ee6be33ad123cb15ed
BLAKE2b-256 022b974f67b3d2a775e2f49ae775fdba1b88b682673320ef6d3132be5dc4eaf4

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