Skip to main content

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",
    screen_id="test_center",
    screen_context={"active_tab": "sensei", "selected_connector_id": "connector-1"},
)

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. screen_id and screen_context are optional per-message host UI context fields. Use them from Chatbot Dojo to tell Senpai which screen the user is viewing and a small, sanitized set of visible details such as the active tab, selected run/profile/rule id, or visible error. Senpai includes metadata for known screen ids like setup_guide, test_center, chatbot_connectors, projects, tracer_dashboard, sensei_dashboard, sensei_check_dashboard, sensei_check_rules, test_case, yaml_editor, custom_connector_editor, and profile_settings. Avoid passing HTML, DOM dumps, credentials, API keys, large logs, or personal data that is not needed for the answer.

The public package exports:

  • Assistant
  • ScreenInfo
  • create_assistant_for_paths(...)
  • configure_runtime_root(...)
  • get_screen_info(...)
  • get_runtime_root()
  • list_screen_registry()
  • 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

Metadata

Release files for senpai-assistant 0.8.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 senpai-assistant 0.8.0
File Size Uploaded
senpai_assistant-0.8.0.tar.gz 131.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for senpai-assistant 0.8.0
File Interpreter ABI Platform
senpai_assistant-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 239.6 kB

Release files / senpai_assistant-0.8.0.tar.gz

Download URL senpai_assistant-0.8.0.tar.gz
Size 131.4 kB
Tags Source
SHA-256 checksum
How to use checksums
33582efeae2799f53bc7e2bdf96d5b4aa909029d4d72c903be017a661450f4fa
BLAKE2b-256 checksum
How to use checksums
bf268d5a5a3a9336ccb1095b8a8f959bd8e0f7bbeb47692c7d90115f672cbeb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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}

Release files / senpai_assistant-0.8.0-py3-none-any.whl

Download URL senpai_assistant-0.8.0-py3-none-any.whl
Size 108.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9f7eb69c9b7c12240724a37181d87907147b52a9558a0032c39548b3d5b33c5
BLAKE2b-256 checksum
How to use checksums
74852a9f1459c876ab28da2b967aac1edf239dc2c1edb1784e3b434a894a0d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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}

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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