Skip to main content

Build autonomous AI agents in 3 lines of code. Production-ready orchestration with P2P mesh networking.

Project description

JarvisCore Framework

Build autonomous AI agents with P2P mesh networking.

Features

  • AutoAgent - LLM generates and executes code from natural language
  • CustomAgent - Bring your own logic (LangChain, CrewAI, etc.)
  • ListenerAgent - API-first agents with background P2P (just implement handlers)
  • P2P Mesh - Agent discovery and communication via SWIM protocol
  • Workflow Orchestration - Dependencies, context passing, multi-step pipelines
  • FastAPI Integration - 3-line setup with JarvisLifespan
  • Cloud Deployment - Self-registering agents for Docker/K8s

Installation

pip install jarviscore-framework

Setup

# Initialize project
python -m jarviscore.cli.scaffold --examples
cp .env.example .env
# Add your LLM API key to .env

# Validate
python -m jarviscore.cli.check --validate-llm
python -m jarviscore.cli.smoketest

Quick Start

AutoAgent (LLM-Powered)

from jarviscore import Mesh
from jarviscore.profiles import AutoAgent

class CalculatorAgent(AutoAgent):
    role = "calculator"
    capabilities = ["math"]
    system_prompt = "You are a math expert. Store result in 'result'."

mesh = Mesh(mode="autonomous")
mesh.add(CalculatorAgent)
await mesh.start()

results = await mesh.workflow("calc", [
    {"agent": "calculator", "task": "Calculate factorial of 10"}
])
print(results[0]["output"])  # 3628800

CustomAgent (Your Code)

from jarviscore import Mesh
from jarviscore.profiles import CustomAgent

class ProcessorAgent(CustomAgent):
    role = "processor"
    capabilities = ["processing"]

    async def execute_task(self, task):
        data = task.get("params", {}).get("data", [])
        return {"status": "success", "output": [x * 2 for x in data]}

mesh = Mesh(mode="distributed", config={'bind_port': 7950})
mesh.add(ProcessorAgent)
await mesh.start()

results = await mesh.workflow("demo", [
    {"agent": "processor", "task": "Process", "params": {"data": [1, 2, 3]}}
])
print(results[0]["output"])  # [2, 4, 6]

ListenerAgent + FastAPI (API-First)

from fastapi import FastAPI
from jarviscore.profiles import ListenerAgent
from jarviscore.integrations.fastapi import JarvisLifespan

class ProcessorAgent(ListenerAgent):
    role = "processor"
    capabilities = ["processing"]

    async def on_peer_request(self, msg):
        # Handle requests from other agents
        return {"result": msg.data.get("task", "").upper()}

# That's it - 3 lines to integrate with FastAPI
app = FastAPI(lifespan=JarvisLifespan(ProcessorAgent(), mode="p2p"))

Execution Modes

Mode Profile Use Case
autonomous AutoAgent Single machine, LLM code generation
p2p CustomAgent, ListenerAgent Agent-to-agent communication, swarms
distributed CustomAgent, ListenerAgent Multi-node workflows + P2P

What's New in 0.3.0

Developer Experience Improvements:

  • ListenerAgent - No more writing run() loops. Just implement on_peer_request() and on_peer_notify() handlers.
  • JarvisLifespan - FastAPI integration reduced from ~100 lines to 3 lines.
  • Cognitive Discovery - peers.get_cognitive_context() generates LLM-ready peer descriptions. No more hardcoded agent names in prompts.

Cloud Deployment:

  • Self-Registration - agent.join_mesh() lets agents join existing meshes without central orchestrator.
  • Remote Visibility - Agents on different nodes are automatically discovered and callable.

Documentation

Version

0.3.0

License

MIT License

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

jarviscore_framework-0.3.0.tar.gz (272.2 kB view details)

Uploaded Source

Built Distribution

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

jarviscore_framework-0.3.0-py3-none-any.whl (348.1 kB view details)

Uploaded Python 3

File details

Details for the file jarviscore_framework-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for jarviscore_framework-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a34d31f8d98698c036cca05e4edb2f007c1e3a673aec118593cd71e71e41a8b0
MD5 a746236a6b85d663f53dbcb33640b8f8
BLAKE2b-256 bd326118db5a658e79c8e0f47b6d312a0a809607bf2e070701c3b5d68e8f4d9a

See more details on using hashes here.

File details

Details for the file jarviscore_framework-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jarviscore_framework-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d31c8f4a8f6c578c6e872ab321450bbbaf472c5eab8c9d6fcbc9a1fe0f12b6a5
MD5 6cdef298d9b46d144ead6feda713c04f
BLAKE2b-256 4dd77350ec18c94e4e2189e281839cf33881c4eef5040fa1ac66df46bab4876a

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