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.0.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.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentmem_crewai-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2c5ac10d79d184e38e1d7b605fa96e8cac3a3257bb3312166c5a2de7033ac20f
MD5 9affab1d98609c6e0c553159dcbf780d
BLAKE2b-256 03fc5f1657b78538df585ca6c5237e2add6e158c166d9bef78c967a00ea39242

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for agentmem_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4fa74d71f4f1cdb78565912273cb274d528affbdc7c4ca54afbf279d45b36db
MD5 c9c5a159e1cdbb8389213b199c8161f9
BLAKE2b-256 0f20eec6ed027fcb7fa68453011ceccd063fe36db21a4e01692c1c1c9f7e113e

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