Skip to main content

crewai-xache

CrewAI integration for Xache Protocol - verifiable AI agent memory with cryptographic receipts, collective intelligence, ephemeral working memory, knowledge graph, and portable ERC-8004 reputation.

Installation

pip install crewai-xache

Quick Start

Add Xache Tools to Your Crew

from crewai import Agent, Task, Crew
from xache_crewai import xache_tools

researcher = Agent(
    role="Researcher",
    goal="Research and remember important findings",
    backstory="An expert researcher with persistent memory",
    tools=xache_tools(
        wallet_address="0x...",
        private_key="0x..."
    )
)

task = Task(
    description="Research quantum computing and store key findings",
    agent=researcher
)

crew = Crew(agents=[researcher], tasks=[task])
crew.kickoff()

Add Persistent Memory to Your Crew

from crewai import Crew
from xache_crewai import XacheMemory

memory = XacheMemory(
    wallet_address="0x...",
    private_key="0x..."
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    memory=memory
)

Available Tools

Memory Tools

  • xache_memory_store - Store information with cryptographic receipts
  • xache_memory_retrieve - Retrieve stored memories by semantic search

Collective Intelligence Tools

  • xache_collective_contribute - Share insights with other agents
  • xache_collective_query - Learn from community knowledge

Knowledge Graph Tools

  • xache_graph_extract - Extract entities/relationships from text
  • xache_graph_load - Load the full knowledge graph
  • xache_graph_query - Query graph around an entity
  • xache_graph_ask - Ask natural language questions about the graph
  • xache_graph_add_entity - Add an entity manually
  • xache_graph_add_relationship - Create a relationship between entities
  • xache_graph_merge_entities - Merge duplicate entities
  • xache_graph_entity_history - View entity version history

Ephemeral Context Tools

  • xache_ephemeral_create_session - Create a short-lived working memory session
  • xache_ephemeral_write_slot - Write data to a session slot
  • xache_ephemeral_read_slot - Read data from a session slot
  • xache_ephemeral_promote - Promote session to persistent memory

Extraction Tools

  • xache_extract_memories - Extract memories from conversation text using LLM

Reputation Tools

  • xache_check_reputation - View reputation score and ERC-8004 status

Ephemeral Context

Ephemeral context gives agents short-lived scratch sessions with 6 named slots (conversation, facts, tasks, cache, scratch, handoff). Sessions auto-expire and can be promoted to persistent memory.

from xache_crewai import (
    XacheEphemeralCreateSessionTool,
    XacheEphemeralWriteSlotTool,
    XacheEphemeralReadSlotTool,
    XacheEphemeralPromoteTool,
)

# Create individual tools
create_session = XacheEphemeralCreateSessionTool(
    wallet_address="0x...",
    private_key="0x..."
)

write_slot = XacheEphemeralWriteSlotTool(
    wallet_address="0x...",
    private_key="0x..."
)

# Or include in the full tool set
tools = xache_tools(
    wallet_address="0x...",
    private_key="0x...",
    include_ephemeral=True  # included by default
)

Use cases for crews:

  • Hand off context between agents in a pipeline (use the handoff slot)
  • Track task progress across crew execution steps
  • Accumulate facts during research, then promote the best ones

Selective Tool Loading

# Only memory tools
tools = xache_tools(
    wallet_address="0x...",
    private_key="0x...",
    include_memory=True,
    include_collective=False,
    include_reputation=False,
    include_graph=False,
    include_extraction=False,
    include_ephemeral=False,
)

# Only ephemeral + graph
tools = xache_tools(
    wallet_address="0x...",
    private_key="0x...",
    include_memory=False,
    include_collective=False,
    include_reputation=False,
    include_graph=True,
    include_extraction=False,
    include_ephemeral=True,
)

Memory Types

Standard Memory

from xache_crewai import XacheMemory

memory = XacheMemory(wallet_address="0x...", private_key="0x...")
memory_id = memory.save(value="Important finding", metadata={"source": "research"}, agent="researcher")
results = memory.search(query="quantum computing", limit=5)

Short-Term / Long-Term Memory

from xache_crewai import XacheShortTermMemory, XacheLongTermMemory

short_term = XacheShortTermMemory(wallet_address="0x...", private_key="0x...")
long_term = XacheLongTermMemory(wallet_address="0x...", private_key="0x...")

Multi-Agent Crews

# Shared wallet = shared memory
shared_config = {
    "wallet_address": "0xSharedWallet...",
    "private_key": "0xSharedKey..."
}

researcher = Agent(role="Researcher", tools=xache_tools(**shared_config))
writer = Agent(role="Writer", tools=xache_tools(**shared_config))

crew = Crew(
    agents=[researcher, writer],
    memory=XacheMemory(**shared_config)
)

Pricing

Operation Price
Memory Store $0.002
Memory Retrieve $0.003
Collective Contribute $0.002
Collective Query $0.011
Ephemeral Session $0.005
Ephemeral Promote $0.05
Extraction (managed) $0.011
Graph Operations $0.002
Graph Ask (managed) $0.011

Resources

License

MIT

Metadata

Release files for crewai-xache 0.5.0

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

Source distribution (sdist)

Source distribution for crewai-xache 0.5.0
File Size Uploaded
crewai_xache-0.5.0.tar.gz 13.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crewai-xache 0.5.0
File Interpreter ABI Platform
crewai_xache-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / crewai_xache-0.5.0.tar.gz

Download URL crewai_xache-0.5.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6dc98344def36c3571ff457d34bfef63731dc36976da262110650d791c860255
BLAKE2b-256 checksum
How to use checksums
b5a58ffa295dc1ebdc8873090cfe4e7e468b7636ae2eda51a55a02320d119d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.6

Release files / crewai_xache-0.5.0-py3-none-any.whl

Download URL crewai_xache-0.5.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20dcbbe05d3dca6a02084f5979206d89572a8fd2392f1f6b56e0beadb28ab57d
BLAKE2b-256 checksum
How to use checksums
7d412223436de90b15e4e15a74f659d4770aa7b2a2378e5a40204b2c8aba2211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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