Skip to main content

The World's First Transactive Memory System for Multi-Agent AI - Gives your agent team a collective mind

Project description

๐Ÿ CogniHive

The World's First Transactive Memory System for Multi-Agent AI

Mem0 gives one agent a brain. CogniHive gives your agent team a collective mind.

PyPI version Python License HuggingFace

Installation โ€ข Quick Start โ€ข Documentation โ€ข Integrations


๐Ÿง  What is Transactive Memory?

In human teams, not everyone remembers everything. Instead, teams develop a shared awareness of who knows what:

  • "Sarah handles the legal stuff"
  • "Mike knows all the technical details"
  • "Ask Jennifer about customer history"

This is called a Transactive Memory System (TMS) โ€” a concept from cognitive science that has never been implemented for AI agents... until now.

๐Ÿ’ก Why CogniHive?

Current multi-agent systems fail because:

Problem Without CogniHive With CogniHive
"Which agent knows X?" Manual orchestration hive.who_knows("topic")
Redundant work Multiple agents research same thing Expertise routing prevents duplication
Conflicting info Silent failures Conflict detection + resolution
Token explosion 15x more tokens (Anthropic's research) Smart routing = massive savings

๐Ÿš€ Installation

pip install cognihive

With framework integrations:

pip install cognihive[crewai]      # For CrewAI
pip install cognihive[autogen]     # For AutoGen
pip install cognihive[all]         # Everything

โšก Quick Start

from cognihive import Hive

# Create a hive (multi-agent memory system)
hive = Hive()

# Register agents with their specializations
hive.register_agent("coder", expertise=["python", "javascript", "testing"])
hive.register_agent("analyst", expertise=["sql", "data", "metrics"])
hive.register_agent("writer", expertise=["docs", "tutorials", "api"])

# Agents store knowledge
hive.remember(
    "Use connection pooling for better DB performance",
    agent="analyst",
    topics=["database", "performance"]
)

# ๐Ÿ” THE KEY INNOVATION: "Who Knows What" queries
experts = hive.who_knows("database optimization")
# Returns: [("analyst", 0.92), ("coder", 0.45)]

# ๐ŸŽฏ Automatic query routing to the right expert
result = hive.ask("How do I optimize my queries?")
# Automatically routes to "analyst" and returns relevant memories

print(f"Expert: {result['expert']}")  # "analyst"
print(f"Answer: {result['memories'][0].content}")

๐Ÿ”— Integrations

CrewAI

from crewai import Agent, Crew
from cognihive.integrations import CrewAIHive

hive = CrewAIHive()

researcher = Agent(
    role="Researcher",
    goal="Find information",
    memory=hive.agent_memory("researcher")  # CogniHive memory!
)

writer = Agent(
    role="Writer",
    goal="Write content",
    memory=hive.agent_memory("writer")  # CogniHive memory!
)

# Now agents automatically:
# โœ“ Know what each other knows
# โœ“ Route questions to the right expert
# โœ“ Share learnings across the team

AutoGen

from autogen import AssistantAgent
from cognihive.integrations import AutoGenHive

hive = AutoGenHive()

# Create agents with shared transactive memory
coder = hive.create_memory_enhanced_agent(
    name="coder",
    system_message="You are an expert coder.",
    expertise=["python", "coding"]
)

reviewer = hive.create_memory_enhanced_agent(
    name="reviewer",
    system_message="You review code for quality.",
    expertise=["review", "testing"]
)

# Agents now have collective intelligence!

LangGraph

from cognihive.integrations import LangGraphHive, create_expert_routing_graph

hive = LangGraphHive()
hive.register_agent("researcher", expertise=["research"])
hive.register_agent("writer", expertise=["writing"])

# Create a graph with automatic expert routing
graph = create_expert_routing_graph(
    hive=hive,
    agent_nodes={
        "researcher": researcher_node,
        "writer": writer_node
    }
)

๐Ÿ› ๏ธ CLI

# Initialize a hive
cognihive init --name my_project

# Register agents
cognihive register coder --expertise python javascript

# Store knowledge
cognihive remember "Important info" --agent coder

# Query "who knows what"
cognihive who-knows "python optimization"

# Search memories
cognihive recall "best practices"

# Run interactive demo
cognihive demo

๐Ÿ“š Documentation

Core Concepts

Concept Description
Hive The central coordinator for multi-agent memory
Agent An entity with expertise that stores/retrieves memories
Memory A piece of knowledge with provenance and access control
ExpertiseProfile Tracks "who knows what" for each agent
ExpertiseRouter Routes queries to the best expert

Key Methods

# Agent management
hive.register_agent(name, expertise, role)
hive.get_agent(name)
hive.list_agents()

# Memory operations
hive.remember(content, agent, topics, visibility)
hive.recall(query, top_k=5)

# Transactive memory (THE INNOVATION)
hive.who_knows(topic)          # Find experts
hive.get_expert(topic)         # Get best expert
hive.expertise_matrix()        # Get full expertise map

# Query routing
hive.ask(query)                # Auto-route + retrieve
hive.route(query)              # Get routing decision

Memory Visibility

# Private - only the owner sees it
hive.remember("Secret notes", agent="coder", visibility="private")

# Shared - specific agents can see
hive.remember("For the team lead", agent="coder", visibility="shared")

# Team - all agents in the hive can see
hive.remember("Team announcement", agent="coder", visibility="team")

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      CogniHive Core                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚               TRANSACTIVE MEMORY INDEX                       โ”‚    โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚    โ”‚
โ”‚  โ”‚  โ”‚ Agent: Coderโ”‚  โ”‚ Agent: Docs โ”‚  โ”‚Agent: Data  โ”‚          โ”‚    โ”‚
โ”‚  โ”‚  โ”‚ Knows:      โ”‚  โ”‚ Knows:      โ”‚  โ”‚ Knows:      โ”‚          โ”‚    โ”‚
โ”‚  โ”‚  โ”‚ - Python    โ”‚  โ”‚ - API specs โ”‚  โ”‚ - SQL       โ”‚          โ”‚    โ”‚
โ”‚  โ”‚  โ”‚ - FastAPI   โ”‚  โ”‚ - Tutorials โ”‚  โ”‚ - Analytics โ”‚          โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜          โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚                    EXPERTISE ROUTER                          โ”‚    โ”‚
โ”‚  โ”‚  Query: "How do I optimize the database queries?"            โ”‚    โ”‚
โ”‚  โ”‚  Routing: Data Agent (0.92) > Coder Agent (0.67)            โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Use Cases

  • Multi-Agent Software Teams - Coder, reviewer, tester, writer working together
  • Research Workflows - Researcher, analyst, writer with shared findings
  • Customer Support - Specialists routing questions to the right expert
  • Enterprise Knowledge - Departments sharing institutional knowledge

๐Ÿ“Š Comparison

Feature Mem0 Zep Letta CogniHive
Single-agent memory โœ… โœ… โœ… โœ…
"Who Knows What" โŒ โŒ โŒ โœ…
Expert routing โŒ โŒ โŒ โœ…
Conflict resolution โŒ โŒ โŒ โœ…
Access control โŒ โŒ โŒ โœ…
CrewAI integration โŒ โŒ โŒ โœ…
AutoGen integration โŒ โŒ โŒ โœ…

๐Ÿค Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments

  • Daniel Wegner - Transactive Memory Systems theory (1985)
  • Anthropic - Multi-agent coordination research
  • Stanford - Generative Agents memory architecture

Built with โค๏ธ for the multi-agent AI community

โญ Star on GitHub โ€ข ๐Ÿ“ฆ PyPI โ€ข ๐Ÿค— HuggingFace Demo

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

cognihive-0.1.2.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

cognihive-0.1.2-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file cognihive-0.1.2.tar.gz.

File metadata

  • Download URL: cognihive-0.1.2.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cognihive-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b9dfa7f06039391844edbd0fab55190f96d16f9442938505d41c2521ee8989d8
MD5 f706dd70f507a6b3e31f45163aae4b6c
BLAKE2b-256 b9c4ce4da82fc3d9dae89b5705dbcca60bd7c9b171ec5d02ec38b118159cfa67

See more details on using hashes here.

File details

Details for the file cognihive-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cognihive-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cognihive-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5bae67b71c1b7368a57ff7b68a30e7d22aff107ecc7e2d99faa0c6768909f3
MD5 d74d4866dae9ef118fff059ee8b82bc1
BLAKE2b-256 34a524fa7771abd7f124e38aceba0eda86bac14507391ed30a73b972c03d6fa8

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