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 quickstartCUSTOMAGENT_GUIDE.md- CustomAgent patterns and framework integrationAUTOAGENT_GUIDE.md- LLM-powered agentsUSER_GUIDE.md- Complete documentationAPI_REFERENCE.md- Detailed API docsCONFIGURATION.md- Settings reference
Version
0.3.2
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f105a639304ee05f300a4d8361a857dc8a51398c96efbc21ed8c1a043a2efcc4
|
|
| MD5 |
5d297dc5a649cd467721814918c7e615
|
|
| BLAKE2b-256 |
ee17eb49d7e1dee1ad5ba9b0297099c8bf719a33acd3440500ee6716a25b1e88
|
File details
Details for the file jarviscore_framework-0.3.2-py3-none-any.whl.
File metadata
- Download URL: jarviscore_framework-0.3.2-py3-none-any.whl
- Upload date:
- Size: 390.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9921b6cd8bf6ac85e64d63c62a290b426450d858b628badc1e1963bf50c4ce4
|
|
| MD5 |
03e478d7b8b4ce3b131acb514a39d2b5
|
|
| BLAKE2b-256 |
efedbd6f7795a08f49fc36136f5404e06ae01ebcf768f203a0c873c239c3f4e2
|