Skip to main content

Synap memory integration for CAMEL-AI — native AgentMemory backed by Synap

Project description

maximem-synap-camel-ai

Synap memory integration for CAMEL-AI — plug Synap in as a native AgentMemory so your ChatAgent gains persistent long-term memory, plus explicit tools and short-term context.

pip install maximem-synap-camel-ai camel-ai

Surfaces

Surface CAMEL extension point Purpose
SynapAgentMemory AgentMemoryChatAgent(memory=...) Recall + persistence layered over CAMEL's own conversation history
create_synap_tools FunctionTool Explicit search_memory / store_memory the model can call
synap_st_system_message ChatAgent(system_message=...) Fold Synap short-term context into the system prompt

Native memory

SynapAgentMemory subclasses CAMEL's ChatHistoryMemory and augments it rather than replacing it — CAMEL's get_context() is the sole source of the model's input, so the memory must return the real conversation (system + user + assistant). On top of that live history it:

  • recalls Synap's long-term memories and prepends them as a system context block (using the latest user turn as the query);
  • persists each completed turn's accumulated transcript to Synap for server-side extraction, under a stable document id.
from camel.agents import ChatAgent
from camel.models import ModelFactory
from maximem_synap import MaximemSynapSDK
from synap_camel_ai import SynapAgentMemory

sdk = MaximemSynapSDK(api_key="sk-...")
memory = SynapAgentMemory(sdk, user_id="alice", customer_id="acme")

agent = ChatAgent(
    system_message="You are a concise, friendly support agent.",
    model=ModelFactory.create(model_platform="openai", model_type="gpt-4o"),
    memory=memory,            # constructor only — not agent.memory = ...
)
print(agent.step("Remind me what plan I'm on and my open ticket.").msgs[0].content)

Attach the memory via the constructor (ChatAgent(memory=...)), not agent.memory = ... afterward.

Explicit tools

from synap_camel_ai import create_synap_tools

agent = ChatAgent(
    system_message="You are a helpful assistant.",
    tools=create_synap_tools(sdk, user_id="alice", customer_id="acme"),
)

Short-term context

from synap_camel_ai import SynapAgentMemory, synap_st_system_message

agent = ChatAgent(
    system_message=synap_st_system_message(
        sdk, conversation_id="conv_abc",
        system_message="You are a support agent.",
    ),
    memory=SynapAgentMemory(sdk, user_id="alice"),
)

Error policy

  • Reads (search_memory, memory recall) degrade — a Synap blip returns no recall and the turn continues.
  • The persistence write inside the agent loop is best-effort by default (on_error="fallback") so a transient outage never discards a model response; set on_error="raise" for strict environments.
  • The explicit store_memory tool raises SynapIntegrationError on failure.

Requires Python 3.11+ and camel-ai>=0.2.90.

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

maximem_synap_camel_ai-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

maximem_synap_camel_ai-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: maximem_synap_camel_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for maximem_synap_camel_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e0e116575dbd5b4b3026bb626b823a6e1e1bf6cabfb1fa4f3e2f355b35afd33
MD5 aaf19454c3765fd4552346a95ded6641
BLAKE2b-256 360410a81b464152d79953d05af7fe80566ae94db6484316fc1de8bac7dc68d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for maximem_synap_camel_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c06af1d7d68f4c9baba683255888c1a24909cffaf1f853aa85d54f6aabcd7ab7
MD5 e53f086980985cf9cfacaf1027a1bbdc
BLAKE2b-256 e1a2e47ec36fed90aa8ddbc4fd0e3d11418e676ac45baa4ac1598a3ad1d10c1f

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