Skip to content

feat(sdk): CrewAI tool adapter (Engram as agent memory)#31

Open
jakerated-r wants to merge 3 commits into
Dipraise1:mainfrom
jakerated-r:feat/crewai-tools
Open

feat(sdk): CrewAI tool adapter (Engram as agent memory)#31
jakerated-r wants to merge 3 commits into
Dipraise1:mainfrom
jakerated-r:feat/crewai-tools

Conversation

@jakerated-r

Copy link
Copy Markdown

What

Adds a CrewAI tool adapter for Engram, completing the agent-framework set the
LangChain (engram/sdk/langchain.py) and LlamaIndex (engram/sdk/llama_index.py)
adapters already cover. CONTRIBUTING.md lists "SDK examples for LangChain, LlamaIndex, agents"
as a high-impact area, and ROADMAP's good-first-issues call for "an agent example (LangChain, CrewAI, LlamaIndex)." — CrewAI was the missing one.

Changes (scoped to one reviewable PR)

  • engram/sdk/crewai.pyEngramStoreTool and EngramSearchTool (CrewAI BaseTools) plus an engram_memory_tools() factory. Lets a CrewAI agent use an Engram miner as durable, semantic long-term memory (store facts in one task, recall them by meaning in another). Wraps the existing EngramClient (ingest / query) — no protocol changes.
  • examples/crewai_agent_memory.py — runnable example wiring the tools into a CrewAI Agent/Crew, with a --tools-only path that needs no LLM/API key.
  • scripts/test_crewai_sdk.py — offline-safe test in the style of scripts/test_sdk.py.

Design notes

  • Lazy import, identical to the LangChain/LlamaIndex adapters: importing the module never hard-requires CrewAI; a helpful ImportError is raised only at tool construction if crewai is missing.
  • Graceful degradation: when the miner is offline, _run returns an error string (what a CrewAI agent expects) rather than raising — so a missing miner doesn't crash a crew.

Verification

  • python scripts/test_crewai_sdk.py — passes both with CrewAI installed (11/11: construction, names, args_schema, offline degradation) and without it (3/3: import + graceful ImportError).
  • Tool logic verified against a pydantic-v2 BaseTool stand-in (CrewAI's BaseTool is a pydantic model).
  • Honest limitation: end-to-end ingest/query against a live miner was not run in this environment (no local miner). The adapter calls the same EngramClient.ingest/query methods the LangChain adapter uses and that scripts/test_sdk.py already covers live; happy to add a live integration check or adjust to match a crewai-tools import path you prefer.

Keeps scope small per CONTRIBUTING; no unrelated formatting or refactors.

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@jakerated-r is attempting to deploy a commit to the praise's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant