Skip to main content

Reusable kit for building LangChain-based assistant services with auth, tenancy, tools, RAG, tracing, and observability.

Project description

Assistant Service Kit

Reusable Python package for building LangChain-based assistant services with FastAPI, auth, tenancy, tools, RAG, tracing, storage, and observability.

Install

Base runtime:

pip install assistant-service-kit

Provider-specific installs:

pip install "assistant-service-kit[rag,gemini]"
pip install "assistant-service-kit[rag,openai]"
pip install "assistant-service-kit[rag,anthropic]"

For local development from this package directory:

pip install -e ".[dev]"

Core Pieces

  • AssistantDefinition: declares the assistant server contract.
  • AssistantEndpoints / EndpointPolicy: declares enabled routes, custom paths, names, and endpoint permissions.
  • AuthConnector: supports no-auth, user-only, gateway token, API key, and custom identity resolution.
  • LLMProviderRegistry: Gemini, OpenAI, Anthropic, and fake chat model providers.
  • EmbeddingProviderRegistry: Gemini, OpenAI, Anthropic, and fake embedding providers.
  • ToolRegistry / ToolPolicy: exposes and validates tools by tenant, user, roles, and limits.
  • SQLAlchemyTraceStore / InMemoryTraceStore: reusable chat trace persistence.
  • PostgresRagStore / VectorStoreConnector: reusable RAG storage and vector-store integration points.
  • answer_with_langchain_agent: LangChain tool-calling orchestrator with observability metadata.

Minimal Example

from assistant_service_kit import (
    AssistantDefinition,
    AssistantEndpoints,
    ConfiguredLLMConnector,
    InMemoryTraceStore,
    LLMRuntimeConfig,
    NoAuthConnector,
    TenancyMode,
    ToolRegistry,
    create_assistant_server,
)

definition = AssistantDefinition(
    name="demo",
    title="Demo Assistant",
    base_path="/api/assistant",
    tenancy_mode=TenancyMode.NONE,
    system_prompt="Answer clearly.",
    tool_registry=ToolRegistry([]),
    llm=ConfiguredLLMConnector(
        config_factory=lambda: LLMRuntimeConfig(provider="fake", model="fake", extra={"response": "ok"})
    ),
    create_schema=lambda: None,
    get_db=lambda: None,
    trace=InMemoryTraceStore(),
    auth=NoAuthConnector(),
    endpoints=AssistantEndpoints(chat=False, conversations=False, messages=False, feedback=False),
)

app = create_assistant_server(definition)

Status

The package is in alpha. APIs can change until the first stable release.

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

assistant_service_kit-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

assistant_service_kit-0.1.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file assistant_service_kit-0.1.0.tar.gz.

File metadata

  • Download URL: assistant_service_kit-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.9

File hashes

Hashes for assistant_service_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54a2274d047667a8d78e8cfdac68add086f6dc52e95975ee77ebb6db783abf31
MD5 b1c5ba16499a4ddf83e0c8402aebb6ef
BLAKE2b-256 148af1bec45a8901604e60b04457923f44e7677be72424238aac9d711649e0a6

See more details on using hashes here.

File details

Details for the file assistant_service_kit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for assistant_service_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb5d30b1dec915bcda110d3e79951fc849412d510e7c2fea067ca14540568fd0
MD5 4fdd7f805262ca0c992735a2e9c44ef2
BLAKE2b-256 e2528ba78b4053c61e92277626fd64675bfcece2e4b8175bfc560b9b1ab0b65d

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