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

  • Assistant: simple facade for building a FastAPI assistant quickly.
  • 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 (
    Assistant,
    AssistantEndpoints,
)

assistant = Assistant(
    name="demo",
    title="Demo Assistant",
    base_path="/api/assistant",
    tenancy="none",
    prompt="Answer clearly.",
    endpoints=AssistantEndpoints(chat=False, conversations=False, messages=False, feedback=False),
)

assistant.with_no_auth()
assistant.with_llm(provider="fake", model="fake", extra={"response": "ok"})
assistant.with_memory_trace()

app = assistant.fastapi(create_schema=lambda: None, get_db=lambda: None)

For advanced integrations, build AssistantDefinition and connectors directly.

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.2.0.tar.gz (21.0 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.2.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: assistant_service_kit-0.2.0.tar.gz
  • Upload date:
  • Size: 21.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 57efce04f3366a88a1ac8d513fa7f2c106b0b2553895edb4ee1e3e3474a004fa
MD5 ca812f706744e167739d1bb061066aa3
BLAKE2b-256 b967973f8aa09086233fe72c90926ca0e06ada5c64e80b1b6e255c347d5df975

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assistant_service_kit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a70f853e8107f8e3caabc15234f40c0f316380b3146d7ec1635693cf0aa55b4d
MD5 a75c5c0ed0b3a227666bb2fc45ef0439
BLAKE2b-256 5d2f5d8d3cb686e265c39819e6950f0fa668afeeaccdc973aa25597346e6b57c

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