Skip to main content

AgentMem integration for CrewAI — drop-in memory tools for any Crew agent

Project description

agentmem-crewai

CrewAI integration for AgentMem. Ships two pre-built tools that match the shape of CrewAI's built-in RecallMemoryTool / RememberTool — agents get hybrid retrieval (semantic + keyword + graph), multi-agent scoping, and Postgres-native storage with one config object.

pip install agentmem-crewai

Quick start

from crewai import Agent, Crew, Task
from agentmem_crewai import AgentMemConfig, create_agentmem_tools

config = AgentMemConfig(
    api_key="sk-...",
    agent_id="support-bot",
    scope="team",         # optional default
)

support = Agent(
    role="Support specialist",
    goal="Help customers and remember what they prefer.",
    backstory="...",
    tools=create_agentmem_tools(config),
)

crew = Crew(agents=[support], tasks=[Task(...)])
crew.kickoff()

The agent now has two tools — Search memory and Save to memory — that hit AgentMem instead of the local LanceDB/Mem0 default.

Tools

Tool Purpose Input
AgentMemRecallTool Hybrid search; returns top hits with scores. queries: list[str]
AgentMemRememberTool Writes one or more facts. contents: list[str]

Both match CrewAI's built-in shape (name, description, args_schema), so agents pick them automatically — you don't have to retrain on tool descriptions.

Helpers (without tools)

For custom flows — pre-search before a task starts, post-extract facts after a run, etc.:

from agentmem_crewai import add_memory, recall_memories, search_memories

await_text = recall_memories("what does this customer prefer?", config)
# → "Relevant memories...\n- (score=0.85) ..."

hits = search_memories("escalation policy", config)
# → list[MemoryHit]

add_memory("Customer prefers email over phone.", config)

Config reference

Field Default Purpose
api_key Required.
agent_id Required.
base_url hosted Self-host override.
scope private Default visibility for writes.
role Default agent role.
workflow_id Group memories by workflow / session.
top_k 5 Max hits per recall.
rerank false Re-score with Gemini (+0.5-1.5s).
min_score 0.0 Drop hits below this score.

Comparison

CrewAI's built-in memory uses LanceDB (or Mem0 if configured). This package gives you AgentMem's Postgres-native, multi-agent-aware memory layer through the same tool interface — no Memory rewrite, no separate storage layer.

License

Apache-2.0

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

agentmem_crewai-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

agentmem_crewai-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file agentmem_crewai-0.1.1.tar.gz.

File metadata

  • Download URL: agentmem_crewai-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for agentmem_crewai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e753e420690a3ce4398b5032e60cf21623557355364aa8c1084ee1cc49ced230
MD5 da98842081bb49bbc0fb218e9469a3f3
BLAKE2b-256 fe9bc3c0482fc1f75147234331ee7d8d1fdfc7836f44f9d01469e69e64001dc4

See more details on using hashes here.

File details

Details for the file agentmem_crewai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentmem_crewai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1040b2bd698a568bf2238f6cc1802b0c24133245d9c64e89e056f2a92db3aa09
MD5 0ef812bae66a978fb56af928b4d5c1c7
BLAKE2b-256 5e73764fcf13a19e89b711f5291002ab11f80fc06ca32b4180675c9521f12cb7

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