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 with P2P message 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
  • Cognitive Discovery - LLM-ready peer descriptions for autonomous delegation
  • 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 + FastAPI (Recommended)

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

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

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

# 3 lines to integrate with FastAPI
app = FastAPI(lifespan=JarvisLifespan(ProcessorAgent(), mode="p2p"))

CustomAgent (Workflow Mode)

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]

Profiles

Profile You Write JarvisCore Handles
AutoAgent System prompt LLM code generation, sandboxed execution
CustomAgent on_peer_request() and/or execute_task() Mesh, discovery, routing, lifecycle

Execution Modes

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

Framework Integration

JarvisCore is async-first. Best experience with async frameworks.

Framework Integration
FastAPI JarvisLifespan (3 lines)
aiohttp, Quart, Tornado Manual lifecycle (see docs)
Flask, Django Background thread pattern (see docs)

Documentation

Documentation is included with the package:

python -c "import jarviscore; print(jarviscore.__path__[0] + '/docs')"

Available guides:

  • GETTING_STARTED.md - 5-minute quickstart
  • CUSTOMAGENT_GUIDE.md - CustomAgent patterns and framework integration
  • AUTOAGENT_GUIDE.md - LLM-powered agents
  • USER_GUIDE.md - Complete documentation
  • API_REFERENCE.md - Detailed API docs
  • CONFIGURATION.md - Settings reference

Version

0.3.2

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.2.tar.gz (311.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.2-py3-none-any.whl (390.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jarviscore_framework-0.3.2.tar.gz
  • Upload date:
  • Size: 311.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.2.tar.gz
Algorithm Hash digest
SHA256 f105a639304ee05f300a4d8361a857dc8a51398c96efbc21ed8c1a043a2efcc4
MD5 5d297dc5a649cd467721814918c7e615
BLAKE2b-256 ee17eb49d7e1dee1ad5ba9b0297099c8bf719a33acd3440500ee6716a25b1e88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jarviscore_framework-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9921b6cd8bf6ac85e64d63c62a290b426450d858b628badc1e1963bf50c4ce4
MD5 03e478d7b8b4ce3b131acb514a39d2b5
BLAKE2b-256 efedbd6f7795a08f49fc36136f5404e06ae01ebcf768f203a0c873c239c3f4e2

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