Praval: Multi-Agent AI Framework๏ƒ

PyPI version Python versions License

The Pythonic Multi-Agent AI Framework for building intelligent, collaborative agent systems

Praval (เคชเฅเคฐเคตเคพเคฒ) - Sanskrit for coral, representing how simple agents collaborate to create complex, intelligent ecosystems.


Overview๏ƒ

Praval is a revolutionary Python framework that transforms complex AI applications into simple, composable agent systems. Instead of monolithic AI systems, Praval enables you to create ecosystems of specialized agents that collaborate intelligently through a coral reef-inspired architecture.

Key Features:

๐ŸŽฏ Decorator-Based API

Transform functions into intelligent agents with simple @agent() decorators

๐ŸŒŠ Reef Communication

Knowledge-first messaging between agents through structured โ€œsporesโ€

๐Ÿง  Comprehensive Memory

Multi-layered memory system with vector search and persistent storage

๐Ÿ”ง Multi-LLM Support

Seamless integration with OpenAI, Anthropic, and Cohere

๐Ÿ—๏ธ Self-Organizing

Agents coordinate without central orchestration

๐ŸŽจ Production-Ready

Built with type safety, error handling, and scalability in mind

Quick Start๏ƒ

Installation๏ƒ

# Minimal installation
pip install praval

# With memory system
pip install praval[memory]

# With all features
pip install praval[all]

Your First Agent๏ƒ

Create a simple agent in just a few lines:

from praval import agent, chat, broadcast, start_agents

@agent("researcher", responds_to=["research_query"])
def research_agent(spore):
    """I'm an expert at finding and analyzing information."""
    query = spore.knowledge.get("query")
    result = chat(f"Research this topic deeply: {query}")

    broadcast({
        "type": "research_complete",
        "findings": result,
        "confidence": 0.9
    })

    return {"research": result}

# Start the agent system
start_agents()

# Send a research query
broadcast({
    "type": "research_query",
    "query": "What are the latest developments in multi-agent AI?"
})

Thatโ€™s it! Youโ€™ve created an intelligent research agent that:

โœ“ Listens for research queries โœ“ Uses AI to generate insights โœ“ Broadcasts results to other agents โœ“ Returns structured data

Architecture Philosophy๏ƒ

Praval is inspired by coral reef ecosystems:

The Coral Reef Metaphor

Just as coral polyps are simple organisms that create complex reef ecosystems through collaboration, Praval agents are specialized functions that create sophisticated AI systems through communication.

Design Principles:

  1. Specialization Over Generalization - Each agent excels at one thing

  2. Declarative Design - Define what agents ARE, not what they DO

  3. Emergent Intelligence - Complex behaviors from simple interactions

  4. Zero Configuration - Sensible defaults, progressive enhancement

  5. Composability - Agents combine naturally through standard interfaces

Whatโ€™s Inside๏ƒ

Additional Resources

Key Capabilities๏ƒ

Decorator-Based Agent Creation๏ƒ

Transform any Python function into an intelligent agent:

@agent("explorer", channel="knowledge", responds_to=["concept_request"])
def explore_concepts(spore):
    '''Find related concepts and broadcast discoveries.'''
    concepts = chat("Related to: " + spore.knowledge.get("concept", ""))
    return {"type": "discovery", "discovered": concepts.split(",")}

Reef Communication System๏ƒ

Agents communicate through a structured messaging protocol:

# Broadcast a message to all listening agents
broadcast({
    "type": "task_request",
    "task": "analyze_data",
    "priority": "high"
})

# Agents automatically filter messages they care about
@agent("analyst", responds_to=["task_request"])
def handle_tasks(spore):
    if spore.knowledge.get("task") == "analyze_data":
        # Process the task
        return {"status": "completed"}

Memory System๏ƒ

Multi-layered memory for persistent, intelligent agents:

@agent("researcher", memory=True, knowledge_base="./docs/")
def expert_agent(spore):
    '''Expert with pre-loaded knowledge base.'''
    question = spore.knowledge.get("question")

    # Search long-term memory
    relevant_info = expert_agent.recall(question)

    # Store new knowledge
    expert_agent.remember(f"Answered: {question}")

    return {"answer": chat(f"Answer based on: {relevant_info}")}

Community & Support๏ƒ

Version Information๏ƒ

Current version: 0.7.9

Changelog:

  • v0.7.9 - Latest release with enhanced storage and tool systems

  • v0.7.x - Tool system, secure spores, unified storage

  • v0.6.x - Memory system integration

  • v0.5.x - Knowledge base and PDF support

  • v0.3.x - Multi-LLM provider support

See the Changelog for detailed version history.

License๏ƒ

Praval is released under the MIT License. See License for details.

Indices and tables๏ƒ