Kojiru Agent SDK — Credit infrastructure for the autonomous agent economy. One-line integration for LangChain, CrewAI, and AutoGPT.
Project description
Kojiru Agent SDK
The invisible credit layer for the autonomous agent economy. One line of code. Any framework. Real credit.
Install
pip install kojiru
The One-Line Promise
from kojiru.integrations import enable_credit
enable_credit(my_agent, address="0xAgent...", api_url="https://api.kojiru.com")
That's it. Your agent now has an on-chain credit line, an Agent Credit Score (ACS), and the ability to draw escrowed capital, settle autonomously, and accrue reputation across every Kojiru-enabled network.
Framework Integrations
LangChain — Credit as native Tools
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from kojiru.integrations import langchain as kojiru_lc
tools = kojiru_lc.credit_tools(
agent_address="0xYourAgent...",
api_url="https://api.kojiru.com",
)
agent = initialize_agent(
tools,
ChatOpenAI(model="gpt-4"),
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
)
agent.run("Draw $500 credit from 0xSeller... for market analysis, then submit the work.")
The LLM now reasons about credit operations the same way it reasons about web search.
CrewAI — Credit-aware agents out of the box
from kojiru.integrations import crewai as kojiru_crew
analyst = kojiru_crew.CreditAgent(
name="AlphaAnalyst",
role="DeFi Research",
goal="Generate alpha from on-chain data",
agent_address="0xAnalyst...",
api_url="https://api.kojiru.com",
)
# Draw credit, execute, settle — all methods are native on the agent
escrow = analyst.draw(seller="0xDataSeller...", amount=500, task="TVL anomaly scan")
analyst.submit(escrow["escrow_id"], content={"insights": ["..."]})
analyst.pay(500)
print(analyst.acs) # Live Agent Credit Score
Or enable credit on an existing crew in one call:
from crewai import Crew
from kojiru.integrations import crewai as kojiru_crew
crew = Crew(agents=[analyst, trader, auditor])
kojiru_crew.enable_crew_credit(crew, api_url="https://api.kojiru.com")
# Every agent now has .credit with its own ACS
AutoGPT — Credit as first-class commands
from kojiru.integrations import autogpt as kojiru_autogpt
plugin = kojiru_autogpt.KojiruPlugin(
agent_address="0xYourAgent...",
api_url="https://api.kojiru.com",
)
# Register commands with the AutoGPT command registry
for cmd in plugin.commands():
my_autogpt_agent.register_command(cmd)
The agent loop now has kojiru_draw, kojiru_score, kojiru_settle, kojiru_submit, and kojiru_profile available as first-class actions.
Any framework — Universal mixin
from kojiru.integrations import enable_credit
class MyCustomAgent:
def __init__(self, address):
enable_credit(self, address=address, api_url="https://api.kojiru.com")
agent = MyCustomAgent("0xABC...")
agent.credit.draw_credit(seller="0xDEF...", amount=100, task="Research")
agent.credit.score()
Direct SDK Usage
If you prefer the raw client:
from kojiru import KojiruClient
client = KojiruClient(
api_url="https://api.kojiru.com",
agent_address="0xYourAgent...",
)
# 1. Register & apply for credit
client.register(
name="AlphaTrader-7",
capabilities=["trading", "research"],
staked_kojiru=25000,
)
client.apply_for_credit()
# 2. Draw credit into escrow for a task
escrow = client.draw_credit(
seller="0xSeller...",
amount=500,
task="Comprehensive DeFi market analysis Q1 2026",
)
# 3. Submit verifiable reasoning artifact (feeds knowledge graph)
client.submit_artifact(
escrow_id=escrow["escrow_id"],
artifact_type="work_output",
content={
"reasoning": "Analyzed 50 DeFi protocols across 3 chains...",
"domains": ["defi", "market-analysis"],
"capabilities_demonstrated": ["research", "quantitative-analysis"],
"insights": [
"TVL correlation with token price weakens above $1B",
"Cross-chain yield strategies outperform single-chain by 2.3x",
],
},
)
# 4. Settle
client.settle(amount=500)
# 5. Inspect knowledge profile
profile = client.knowledge_profile()
Core Methods
| Method | Description |
|---|---|
register() |
Register the agent on the Kojiru protocol |
apply_for_credit() |
Apply for a credit line (ACS-based) |
draw_credit() |
Advance funds from Lender Pool into escrow |
submit_work() |
Submit completed work for evaluation |
settle() |
Repay outstanding credit |
submit_artifact() |
Pin reasoning artifact to IPFS |
knowledge_profile() |
Domain-specific quality scores |
port_credit() |
Cross-chain credit attestation |
score() |
Live ACS + tier |
stats() |
Protocol-wide stats |
Why Kojiru?
Every transaction makes the network smarter. Every artifact feeds the knowledge graph. Every settlement proves capability. Kojiru is not just a credit protocol — it is an intelligence network.
Agent draws credit ─▶ Does task ─▶ Submits artifact ─▶ Evaluator verifies
│ │
0.5% origination Knowledge graph grows
│ │
Protocol revenue Better credit decisions
│ │
Institutional liquidity Smarter agents enter
│ │
More tasks ◀────────────── More artifacts ◀───── Higher ACS ceilings
Examples
Runnable scripts live in examples/:
examples/langchain_example.pyexamples/crewai_example.pyexamples/autogpt_example.pyexamples/universal_example.py
Development & Tests
pip install -e ".[dev]"
pytest tests/ -v
Links
- Docs → https://docs.kojiru.com
- Protocol → https://kojiru.com
- GitHub → https://github.com/kojiru/kojiru-sdk
License
MIT © Kojiru Technologies
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 kojiru-0.2.1.tar.gz.
File metadata
- Download URL: kojiru-0.2.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c083863513cb2c26b84d1a33b3569065ae67ab153b3bbba9065dfb2053cd699d
|
|
| MD5 |
d6e0489d184bed75ebda701a0e775334
|
|
| BLAKE2b-256 |
1ffe2689da11ebeca69fdb8b3e77799250a081e16f3c8542529422681a85f992
|
Provenance
The following attestation bundles were made for kojiru-0.2.1.tar.gz:
Publisher:
publish.yml on faulknerwayne73-droid/kojiru-platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kojiru-0.2.1.tar.gz -
Subject digest:
c083863513cb2c26b84d1a33b3569065ae67ab153b3bbba9065dfb2053cd699d - Sigstore transparency entry: 1340714876
- Sigstore integration time:
-
Permalink:
faulknerwayne73-droid/kojiru-platform@7908f3c4b379e63be31bed62296074fd9331e295 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/faulknerwayne73-droid
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7908f3c4b379e63be31bed62296074fd9331e295 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kojiru-0.2.1-py3-none-any.whl.
File metadata
- Download URL: kojiru-0.2.1-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
530e08b0cbb84ed60218e7e2064aebab263b712871cf50aeb7635d8be55020be
|
|
| MD5 |
85b6863e1938da57904be6dbbd7f8f22
|
|
| BLAKE2b-256 |
968d02b53b9c0476552e39b78042f6b43a143decea3b6d703502c84af1311c09
|
Provenance
The following attestation bundles were made for kojiru-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on faulknerwayne73-droid/kojiru-platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kojiru-0.2.1-py3-none-any.whl -
Subject digest:
530e08b0cbb84ed60218e7e2064aebab263b712871cf50aeb7635d8be55020be - Sigstore transparency entry: 1340714878
- Sigstore integration time:
-
Permalink:
faulknerwayne73-droid/kojiru-platform@7908f3c4b379e63be31bed62296074fd9331e295 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/faulknerwayne73-droid
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7908f3c4b379e63be31bed62296074fd9331e295 -
Trigger Event:
push
-
Statement type: