pipecat-moss: cache_path, load each index once per service, forward frames unchanged

RA
14h ago
+143-77

Summary

pipecat-moss 0.0.3, the version on PyPI, cannot be imported on a fresh install. It pins inferedge-moss, which no longer exports AddDocumentsOptions, and it imports the openai_llm_context module that pipecat-ai 1.8 removed. The source here already moved to moss and LLMContextFrame but was never released. This PR adds what the docs need to teach one service per process, and fixes a frame bug.

  • cache_path on MossRetrievalService, passed to the MossClient. A load in a new process reads an unchanged index from disk instead of downloading it. Requires moss 1.14.0 or later; the lock moves to 1.19.0.
  • load_index loads each index once per service. Later and concurrent calls wait for the same load, a bot that disconnects mid-load does not cancel it, and a failed load is retried by the next call. auto_refresh is passed through, so a long-lived process follows new index versions.
  • Frames are forwarded unchanged. The processor rebuilt LLMContextFrame and LLMMessagesUpdateFrame, dropping speculation (a speculative run then reaches the LLM as a normal turn) and run_llm. It now pushes the frame it received. This issue was first reported in usemoss/pipecat-moss#5.
  • Credentials fall back to MOSS_PROJECT_ID and MOSS_PROJECT_KEY as the README says. Missing credentials raise ValueError instead of failing inside the native client.
  • The example creates one service per process and starts the load while the transport connects. The README and CHANGELOG (under Unreleased) are updated.

Notes

  • Releasing needs a version above 0.0.5 or a publish of 0.0.5. Neither is part of this PR.
  • usemoss/pipecat-moss is an older copy of this package, and its open PRs target that repo.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added persistent caching for Moss indexes with optional automatic refresh.
    • Concurrent requests for the same index now share one loading operation.
    • Added environment-variable fallbacks for Moss credentials and clearer missing-credential errors.
  • Bug Fixes
    • Index-loading failures now propagate correctly and can be retried.
    • Preserved message context and frame properties during retrieval processing.
  • Documentation
    • Updated setup guidance, configuration options, usage examples, and compatibility requirements.