Skip to main content

The soul ecosystem for CrewAI: persistent memory, identity, database schema intelligence, and enterprise API integration.

Project description

crewai-soul 🧠

The soul ecosystem for CrewAI agents.

One package, full stack:

  • Persistent Memory — Markdown-native, git-versionable, human-readable
  • Hybrid Retrieval — RAG + RLM via soul-agent
  • Database Intelligence — Auto-generated semantic layers via soul-schema
  • Managed Cloud OptionSoulMate handles memory infrastructure for you

Choose Your Setup

Setup Best For Storage
Local (default) Development, git-tracked projects SOUL.md + MEMORY.md files
SoulMate (managed) Production, teams, zero-infra Cloud API (we handle it)

Both use the same soul-agent RAG+RLM under the hood.

Install

pip install crewai-soul

This automatically installs:

  • soul-agent — Hybrid RAG+RLM memory
  • soul-schema — Database semantic layer generator

Quick Start

Basic Memory

from crewai import Crew, Agent, Task
from crewai_soul import SoulMemory

# Create markdown-based memory with full RAG+RLM
memory = SoulMemory()

# Use it with your crew
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task],
    memory=memory,
)

result = crew.kickoff()

Your crew's memories are stored in MEMORY.md — human-readable, git-versionable, no database required.

Database Schema Intelligence

Give your agents understanding of database structure:

from crewai_soul import SchemaMemory

# Connect to any SQLAlchemy-compatible database
schema = SchemaMemory("postgresql://user:pass@host/db")

# Auto-generate semantic descriptions using LLM
schema.generate()

# Get context for natural language queries
context = schema.context_for("Show me revenue by region")
# Returns formatted markdown with relevant tables/columns

# Use in agent prompts
agent = Agent(
    role="Data Analyst",
    goal="Answer business questions with SQL",
    backstory=f"You have access to this schema:\n{schema.to_markdown()}"
)

SoulMate: Managed Memory (Recommended for Production)

Don't want to manage files? SoulMate is the managed version of soul-agent — same RAG+RLM, zero infrastructure:

from crewai_soul import SoulMateClient

client = SoulMateClient(
    api_key="your-key",
    tenant_id="your-org"
)

# Store memories in the cloud
client.remember("Critical decision: We're going with PostgreSQL", scope="/project/alpha")

# Semantic search across all memories
results = client.recall("database decisions")

# Full RAG+RLM question answering
answer = client.ask("What database did we choose for Project Alpha?")

Why crewai-soul?

Feature CrewAI Built-in crewai-soul
Storage Vector database Markdown files + optional vectors
Human-readable
Git-versionable
Database schema context ✅ (soul-schema)
Enterprise multi-tenant ✅ (SoulMate API)
RAG + RLM hybrid ✅ (soul-agent)
Infrastructure Database server None (or cloud API)

API Reference

SoulMemory

from crewai_soul import SoulMemory

memory = SoulMemory(
    soul_path="SOUL.md",      # Agent identity
    memory_path="MEMORY.md",  # Memory log
    provider="anthropic",     # LLM provider for RAG
    use_hybrid=True,          # Enable RAG+RLM (default: True if soul-agent installed)
)

# Store a memory
memory.remember("We decided to use PostgreSQL.", scope="/decisions")

# Recall relevant memories
matches = memory.recall("What database did we choose?", limit=5)
for m in matches:
    print(f"[{m.score:.2f}] {m.content}")

# Clear memories (optionally by scope)
memory.forget(scope="/decisions")

# Get stats
print(memory.info())

# View structure
print(memory.tree())

SchemaMemory

from crewai_soul import SchemaMemory

schema = SchemaMemory(
    database_url="postgresql://...",
    llm_provider="anthropic",
)

# Generate descriptions for all tables
schema.generate()

# Or specific tables only
schema.generate(tables=["customers", "orders"])

# Get single table description
info = schema.describe("customers")

# Generate context for a query
context = schema.context_for("revenue by region")

# Export in different formats
schema.save("schema.json", format="json")
schema.save("schema.yml", format="dbt")
schema.save("training.jsonl", format="vanna")

# Full markdown documentation
docs = schema.to_markdown()

SoulMateClient

from crewai_soul import SoulMateClient

client = SoulMateClient(
    api_key="...",              # or SOULMATE_API_KEY env var
    base_url="...",             # or SOULMATE_URL env var
    tenant_id="...",            # for multi-tenant isolation
)

# Store memories
client.remember("Important fact", scope="/project")

# Search
results = client.recall("important", limit=10)

# Full RAG+RLM Q&A
answer = client.ask("What do we know about...")

# Clear memories
client.forget(scope="/project")

# Get stats
info = client.info()

The Soul Ecosystem

crewai-soul brings together:

Package Purpose PyPI
soul-agent Persistent memory & identity pip install soul-agent
soul-schema Database semantic layers pip install soul-schema
crewai-soul CrewAI integration (this package) pip install crewai-soul

SoulMate API — Enterprise hosted service for production deployments.

Links

License

MIT

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

crewai_soul-0.3.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

crewai_soul-0.3.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file crewai_soul-0.3.1.tar.gz.

File metadata

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

File hashes

Hashes for crewai_soul-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f515ebb761b12a773668605ddd314ea59593d7a7f38816faeb0dbe1d41e35371
MD5 3f7ae79f4e442f241f032be762a5c593
BLAKE2b-256 6367110b97c1b3837ebefcf72fbd2a5547e8c58c33a89588d0fe02aeb43c7db1

See more details on using hashes here.

File details

Details for the file crewai_soul-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: crewai_soul-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for crewai_soul-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5adf9910b8fde6d37de73496642e0082ff5454c8a90f028b9c12be4cafe679bf
MD5 2582b9eee74bc2237dc66cf3306158d5
BLAKE2b-256 a146cd40269d0dab2cc672f5798c7fab0f19e26101e45164650f98236c18c0f4

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