Python client for fetch.ai AI agent services (code context, context doctor, AI teleporter)
Project description
fetch-agents
Python client for the AgentsLab AI agent services.
Three agents, one SDK:
- Code Context Agent — slim, map, extract, mark code layers
- Context Doctor — compress, analyze, optimize LLM context windows
- AI Teleporter — teleport, search, merge chat export knowledge bases
Install
pip install fetch-agents
Quick Start
from fetch_agents import FetchAgents
# Register once (free, no email required)
info = FetchAgents.register(name="myapp")
api_key = info["api_key"] # save this
client = FetchAgents(api_key=api_key)
# Slim a code file to only the layers relevant to your task
result = client.slim(
url="https://raw.githubusercontent.com/you/repo/main/app.py",
task="fix the auth handler"
)
print(result["context"])
# Compress LLM context to reduce tokens
result = client.compress(text="...long assistant output...", max_length=200)
print(result["compressed"])
# Teleport a chat export into a searchable knowledge base
with open("chatgpt_export.json") as f:
data = f.read()
index = client.teleport(data)
hits = client.search(index["index_id"], query="how do I fix auth?")
API Key via Environment
export FETCH_API_KEY=fak_xxx
client = FetchAgents() # picks up FETCH_API_KEY automatically
Free Tier
50 requests/day per key, no credit card needed. For higher volume, top up with crypto:
invoice = client.topup(amount_usd=5, currency="btc")
print(invoice["pay_url"]) # pay this address
Supported: BTC, LTC, BCH, DOGE, TRX, ETH, BNB, USDT, USDC, and more.
All Methods
| Method | Agent | Description |
|---|---|---|
register(name) |
— | Self-service registration, returns API key |
me() |
— | Quota + balance |
topup(amount_usd, currency) |
— | Create crypto invoice |
topup_status(invoice_id) |
— | Check invoice status |
currencies() |
— | List supported currencies |
slim(url, task) |
Code Context | Relevant layers only |
map(url) |
Code Context | List all LAYER sections |
extract(url, layer) |
Code Context | Extract one layer |
mark(url) |
Code Context | Auto-insert LAYER markers |
compress(text, max_length) |
Context Doctor | Token-compress text |
analyze(messages) |
Context Doctor | Score messages by importance |
optimize(messages) |
Context Doctor | Remove noise, compress verbose turns |
extract_memory(messages) |
Context Doctor | Extract structured facts |
teleport(data) |
AI Teleporter | Upload chat export, create index |
search(index_id, query, top_k) |
AI Teleporter | Semantic search |
merge(index_ids) |
AI Teleporter | Merge indexes |
formats() |
AI Teleporter | List supported export formats |
Links
- Website & docs: https://agentslab.duckdns.org
- Issues: https://github.com/SoftwareValete/fetch-agents/issues
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 fetch_agents-0.1.0.tar.gz.
File metadata
- Download URL: fetch_agents-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55dfb1f611cde03aab7665043eb1a77e13db92ce6f417b32bb9c39bb406120c1
|
|
| MD5 |
d110f70aef67cf64acac4d77e0ffdbc2
|
|
| BLAKE2b-256 |
f5d30387c6784760d1ae9f81b5041136829484ab934d8829190d9f72ccaba86a
|
File details
Details for the file fetch_agents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fetch_agents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.4 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 |
ba5fa4019d278e0832a4dab88c3024fddccb6e79dfecd9d1a4152877f476d22d
|
|
| MD5 |
b41b5dca3bb78c93bc93c79c1e4e9292
|
|
| BLAKE2b-256 |
68420dc7b5f3ccfea5b56c97392244d45aa61151d89a5c6314026f908c5a32bf
|