Skip to main content

synap-pipecat

Synap integration for Pipecat — preload long-term memory into voice pipelines and record every turn back to Synap.

Install

pip install synap-pipecat

Requires pipecat-ai>=0.0.80, maximem-synap>=0.2.0.

Quickstart

from pipecat.pipeline.pipeline import Pipeline
from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import (
    LLMContextAggregatorPair,
    LLMUserAggregator,
    LLMAssistantAggregator,
)
from maximem_synap import MaximemSynapSDK
from synap_pipecat import SynapMemoryProcessor, SynapRecorder

sdk = MaximemSynapSDK(api_key="sk-...")
context = LLMContext(messages=[{"role": "system", "content": "You are a helpful assistant."}])

user_agg = LLMUserAggregator(context=context)
asst_agg = LLMAssistantAggregator(context=context)

pipeline = Pipeline([
    transport.input(),
    stt,
    SynapMemoryProcessor(sdk, user_id="alice", customer_id="acme", context=context),
    user_agg,
    llm,
    tts,
    transport.output(),
    asst_agg,
    SynapRecorder(sdk, user_id="alice", customer_id="acme", context=context),
])

Pass context= to both processors. SynapMemoryProcessor without a context is a read-only tap; it fetches nothing into the prompt. On Pipecat ≥1.x the universal aggregators consume TranscriptionFrame, so a SynapRecorder at the end of the pipeline recovers the user turn from the shared context, and it is also the context Synap's compaction is spliced into. Without context= it records only the assistant half.

Scope

  • SynapMemoryProcessor — sits BEFORE the user context aggregator. On each TranscriptionFrame, fetches relevant context from Synap via sdk.fetch() and appends it as a system message to the shared LLMContext. The transcription frame itself flows through unchanged so the user aggregator can record it as the user turn.
  • SynapRecorder: sits AFTER the assistant context aggregator. Records both turns of each exchange. The user turn comes from the latest TranscriptionFrame to reach the processor, or (on universal-aggregator pipelines where that frame never arrives) from the shared context. The assistant turn comes from streamed LLMTextFrames or the TTSTextFrame stream, or, behind the universal LLMAssistantAggregator, from LLMContextAssistantTurnFrame (see below).
  • SynapShortTermProcessor: sits BEFORE the user aggregator, with the conversation_id of the recorder. Keeps one tagged system block at the head of the context, and never repeats a turn the context already holds.

What the recorder sees depends on where it sits

Pipecat 1.x's LLMAssistantAggregator consumes LLMFullResponseStartFrame/EndFrame, every TextFrame (so TTSTextFrame too), LLMThoughtTextFrame and the function-call frames, and pushes none of them on (llm_response_universal.py, LLMAssistantAggregator.process_frame). Behind it, as in the quickstart, the recorder gets one end-of-turn frame, LLMContextAssistantTurnFrame (pipecat-ai 1.7+), and records the turn from that. Tool calls and results are read back out of the shared context after the turn, since no frame carries them; reasoning is not recoverable there.

To get tool calls at the moment they are dispatched, and reasoning, put the recorder BEFORE the assistant aggregator (for example llm, SynapRecorder(...), tts, ..., asst_agg). It then ends the turn on LLMFullResponseEndFrame, and the aggregator's LLMContextAssistantTurnFrame is ignored so a turn is never recorded twice.

The gRPC stream is the default; REST only as a fallback, never both

The first turn, tool call or tool result opens the stream (sdk.instance.listen()) if you did not, and everything after rides it. The server persists streamed turns itself, so sdk.conversation.record_message is called only when the stream cannot carry the turn. Set SYNAP_AUTO_LISTEN=false (or set_auto_listen(sdk, False) from synap_integrations_common) to stay on REST.

Synap's compaction replaces the earlier turns

With context= given, after each turn it records the recorder checks whether Synap has compacted the conversation. If so, the shared LLMContext is rewritten in place (set_messages, the same call pipecat's own LLMContextSummarizer ends in): the earlier turns become one <synap_conversation_history> system message plus the turns after the compaction, and the current exchange is untouched. Before the first compaction, or if Synap does not answer within 1.5s, the context is left alone and enable_auto_context_summarization (if you turned it on) stays the fallback. SynapShortTermProcessor does the same before each user turn.

Error policy

  • Reads (SynapMemoryProcessor) degrade gracefully — SDK failures log at ERROR and the frame continues downstream with no Synap context injected. A Synap blip must never break a live voice call.
  • Writes (SynapRecorder) that fail on both the stream and REST are logged and pushed upstream as an ErrorFrame carrying a SynapIntegrationError; the pipeline itself stays alive (errors propagate as frames, not exceptions).
  • Non-matching frames pass through untouched in both processors — standard Pipecat push_frame contract.

Constructor args (both processors)

  • sdk: a configured MaximemSynapSDK
  • user_id: required — Synap memory is user-scoped
  • customer_id: B2B instances only, where it is required. Not accepted on a B2C instance, which rejects it with HTTP 400.
  • conversation_id (recorder, short-term processor): optional explicit id for the recorder (auto-generated when absent), required for the short-term processor: pass the same value to both

Metadata

Release files for maximem-synap-pipecat 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maximem-synap-pipecat 0.2.2
File Size Uploaded Provenance Actions
maximem_synap_pipecat-0.2.2.tar.gz 26.8 kB Without provenance Details for maximem_synap_pipecat-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maximem-synap-pipecat 0.2.2
File Interpreter ABI Platform Actions
maximem_synap_pipecat-0.2.2-py3-none-any.whl Python 3 none any Details for maximem_synap_pipecat-0.2.2-py3-none-any.whl

Total release size: 43.9 kB

Release files / maximem_synap_pipecat-0.2.2.tar.gz

Download URL maximem_synap_pipecat-0.2.2.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
12508a3825d8103b6d125d229c12ee238f59754c86293116e9b7fc2454d43d6f
BLAKE2b-256 checksum
How to use checksums
10c29be28f12a7426dad63adf989a54cbb9f351c96aa892494b47869650c4a3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / maximem_synap_pipecat-0.2.2-py3-none-any.whl

Download URL maximem_synap_pipecat-0.2.2-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0b51319b510b1ed6b3d7533212911d30c8d754e72564f1f519b2b5465b329ad
BLAKE2b-256 checksum
How to use checksums
126560791a9800a57c2a1feaf78eee0bc768471088f236f4d0b986c03a6ac10a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for maximem-synap-pipecat 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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