Reproducible agentsAgent tái lập được
Record a full AI agent session, every model call and every tool call, as one tamper-evident trace. Verify it offline at any time, and replay it against the live model to show that every answer comes out the same, bit for bit.Ghi lại toàn bộ một phiên agent AI, gồm mọi lần gọi model và mọi lần gọi công cụ, thành một trace chống sửa đổi. Kiểm chứng ngoại tuyến bất cứ lúc nào, và phát lại trên model đang chạy để chứng minh mọi câu trả lời ra giống hệt, đến từng bit.
How it worksCách hoạt động
- 1RecordGhiWrap your agent in a session. Model calls are made as usual and each answer's signed receipt is stored; tool calls are stored with their arguments and results. Every step is hash-chained to the one before.Bọc agent của bạn trong một session. Các lần gọi model diễn ra như bình thường và biên nhận có chữ ký của từng câu trả lời được lưu lại; lần gọi công cụ được lưu kèm tham số và kết quả. Mỗi bước được nối chuỗi hash với bước trước.
- 2Verify offlineKiểm chứng ngoại tuyếnCheck the chain, every hash, every receipt signature and your own optional Ed25519 signature, with no network access.Kiểm tra chuỗi, mọi hash, mọi chữ ký biên nhận và chữ ký Ed25519 tùy chọn của bạn, không cần mạng.
- 3ReplayPhát lạiRun the agent again. Model calls are re-run on the live model and must match the recording bit for bit; recorded tool results are fed back, so tools are not run again.Chạy lại agent. Các lần gọi model được chạy lại trên model đang hoạt động và phải khớp bản ghi đến từng bit; kết quả công cụ đã ghi được đưa lại, nên công cụ không bị chạy lại.
Replay re-runs the model rather than serving cached output. That is possible because Idemcore inference is deterministic: the same model and input give the same output tokens on every supported device and at every batch size.Phát lại chạy lại model chứ không lấy kết quả đã lưu trong bộ nhớ đệm. Điều đó làm được vì suy luận của Idemcore là tất định: cùng model và đầu vào cho ra cùng các token đầu ra trên mọi thiết bị được hỗ trợ và ở mọi kích thước batch.
Tamper detection and signed receiptsPhát hiện sửa đổi và biên nhận có chữ ký
- Signed receipts: each model answer carries a receipt signed by Idemcore that commits to the model weights, the engine build, the input and the output.Biên nhận có chữ ký: mỗi câu trả lời của model kèm biên nhận do Idemcore ký, cam kết trọng số model, bản build engine, đầu vào và đầu ra.
- Hash chain: an edited, removed, inserted or reordered step, or a changed manifest, makes verification fail.Chuỗi hash: bước bị sửa, bị xóa, bị chèn hay bị đổi thứ tự, hoặc manifest bị đổi, đều khiến kiểm chứng thất bại.
- Receipt match: the recorded prompt, output tokens and text must match the receipt's commitments.Khớp biên nhận: prompt, token đầu ra và văn bản đã ghi phải khớp với cam kết trong biên nhận.
- Your signature: optionally sign the whole trace with your own Ed25519 key and publish the key id.Chữ ký của bạn: có thể ký cả trace bằng khóa Ed25519 của mình và công bố mã khóa.
- Divergence report: if a replayed agent makes a different call, in a different order or with different arguments, replay stops and reports where.Báo cáo lệch: nếu agent khi phát lại gọi khác đi, khác thứ tự hay khác tham số, quá trình phát lại dừng và báo vị trí lệch.
Use casesỨng dụng
- AuditKiểm toánKeep a verifiable record of what an agent saw, which model answered and what it did, step by step.Lưu bản ghi kiểm chứng được về những gì agent đã thấy, model nào đã trả lời và agent đã làm gì, từng bước một.
- Debugging and regression testsGỡ lỗi và kiểm thử hồi quyReplay a failing session exactly, or replay saved sessions after a prompt or tool change to see precisely where behaviour changed.Phát lại chính xác một phiên bị lỗi, hoặc phát lại các phiên đã lưu sau khi đổi prompt hay công cụ để thấy chính xác hành vi thay đổi ở đâu.
- ComplianceTuân thủAutomatic, tamper-evident logs of automated decisions and human approvals, for record-keeping requirements and incident review.Log tự động, chống sửa đổi cho các quyết định tự động và các lần phê duyệt của con người, phục vụ yêu cầu lưu hồ sơ và điều tra sự cố.
- Fintech and legal agentsAgent cho fintech và pháp lýShow a customer, auditor or court how an answer was produced, and reproduce it months later.Chứng minh cho khách hàng, kiểm toán viên hay tòa án câu trả lời đã được tạo ra thế nào, và tái lập nó sau nhiều tháng.
CodeCode
The Python and JavaScript SDKs share one trace format: a session recorded in one verifies and replays in the other.SDK Python và JavaScript dùng chung một định dạng trace: phiên ghi bằng SDK này kiểm chứng và phát lại được bằng SDK kia.
Python
pip install -U "idemcore>=0.2.0"
import idemcore
from idemcore import trace
client = idemcore.Idemcore() # reads IDEMCORE_API_KEY
def get_weather(city):
return {"city": city, "temp_c": 18}
def agent(s):
city = s.chat("Which city is the Eiffel Tower in? One word.", max_tokens=8).text.strip(" .")
w = s.tool("get_weather", {"city": city}, get_weather) # tool call is recorded
return s.chat(f"Weather: {w}. One-sentence forecast.", max_tokens=40).text
# 1. Record
s = trace.Session(client, meta={"job": "forecast-demo"})
agent(s)
s.save("run.trace.json")
# 2. Verify offline (no network)
res = trace.verify_trace(trace.load_trace("run.trace.json"))
assert res.ok, res.errors
# 3. Replay: model calls are re-run and must match bit for bit;
# recorded tool results are fed back, tools are not run again
report = trace.replay(trace.load_trace("run.trace.json"), client, agent=agent)
print(report.summary())
JavaScript
npm i @idemcore/sdk@^0.2.0
import { Idemcore, Session, replay, verifyTrace, dumpsTrace } from "@idemcore/sdk";
import { readFileSync, writeFileSync } from "node:fs";
const client = new Idemcore(); // reads IDEMCORE_API_KEY
const getWeather = ({ city }) => ({ city, temp_c: 18 });
async function agent(s) {
const city = (await s.chat("Which city is the Eiffel Tower in? One word.", { maxTokens: 8 })).text.trim();
const w = await s.tool("get_weather", { city }, getWeather); // recorded
return (await s.chat(`Weather: ${JSON.stringify(w)}. One-sentence forecast.`, { maxTokens: 40 })).text;
}
// 1. Record
const s = new Session(client, { meta: { job: "forecast-demo" } });
await agent(s);
writeFileSync("run.trace.json", dumpsTrace(await s.finish()));
// 2. Verify offline, 3. Replay against the live model
const trace = JSON.parse(readFileSync("run.trace.json", "utf8"));
console.log((await verifyTrace(trace)).ok);
console.log((await replay(trace, client, { agent })).summary());
Command lineDòng lệnh
python -m idemcore trace verify run.trace.json # offline
python -m idemcore trace replay run.trace.json # re-runs the model calls
npx idemcore-trace verify run.trace.json
Full guide: Hướng dẫn đầy đủ: Python SDK docsTài liệu SDK Python · JavaScript SDK docsTài liệu SDK JavaScript · API docsTài liệu API
What a trace proves, and what it does notTrace chứng minh được gì, và không chứng minh được gì
A trace proves that each model answer was produced by Idemcore for exactly that request, and that the sequence of steps has not been edited since it was recorded. Tool results are what your code recorded: the trace shows they were not changed afterwards, but cannot prove the tool returned them. A trace contains your prompts and answers, so store it like the conversation itself.Trace chứng minh mỗi câu trả lời của model do Idemcore tạo ra cho đúng yêu cầu đó, và chuỗi các bước không bị sửa kể từ khi ghi. Kết quả công cụ là những gì code của bạn đã ghi: trace cho thấy chúng không bị đổi về sau, nhưng không chứng minh được công cụ đã trả về chúng. Trace chứa prompt và câu trả lời của bạn, nên hãy lưu trữ nó như chính cuộc hội thoại.
QuestionsCâu hỏi
Does replay serve the recorded answers from a cache?Phát lại có lấy câu trả lời đã ghi từ bộ nhớ đệm không?
No. Replay sends every recorded model request to the live model again and checks that the output tokens, text, chain digest, model and weights hash are identical to the recording. Only tool results are taken from the trace, so tools with side effects are never run twice.Không. Phát lại gửi lại từng yêu cầu model đã ghi tới model đang chạy và kiểm tra token đầu ra, văn bản, chain digest, model và hash trọng số giống hệt bản ghi. Chỉ kết quả công cụ được lấy từ trace, nên công cụ có tác động bên ngoài không bao giờ bị chạy lại.
What happens if someone edits a recorded session?Điều gì xảy ra nếu ai đó sửa một phiên đã ghi?
Verification fails. Each step is hash-chained to the previous one and every model step carries a signed receipt, so an edited, removed, inserted or reordered step, a changed manifest or a prompt or output that no longer matches its receipt is reported. You can also sign the whole trace with your own Ed25519 key.Bước kiểm chứng sẽ báo lỗi. Mỗi bước được nối chuỗi hash với bước trước và mỗi bước model có biên nhận có chữ ký, nên bước bị sửa, bị xóa, bị chèn hay bị đổi thứ tự, manifest bị đổi, hoặc prompt hay đầu ra không còn khớp biên nhận đều bị phát hiện. Bạn cũng có thể ký cả trace bằng khóa Ed25519 của mình.
Can a trace prove what a tool returned?Trace có chứng minh được công cụ đã trả về gì không?
A trace proves the tool result has not changed since it was recorded, but it records what your code saw; it cannot prove the outside system returned it. Sign traces where they are recorded and keep the tool's own logs if that matters.Trace chứng minh kết quả công cụ không bị đổi kể từ lúc ghi, nhưng nó ghi lại những gì code của bạn nhận được; nó không chứng minh được hệ thống bên ngoài đã trả về kết quả đó. Hãy ký trace ngay tại nơi ghi và giữ log riêng của công cụ nếu điều đó quan trọng.
Which SDKs support it?SDK nào hỗ trợ?
The Python SDK (PyPI: idemcore) and the JavaScript SDK (npm: @idemcore/sdk) share one trace format, so a session recorded in one verifies and replays in the other. Both include a command-line tool.SDK Python (PyPI: idemcore) và SDK JavaScript (npm: @idemcore/sdk) dùng chung một định dạng trace, nên phiên ghi bằng SDK này kiểm chứng và phát lại được bằng SDK kia. Cả hai đều có công cụ dòng lệnh.
PricingBảng giá · Verify a resultKiểm chứng kết quả · Talk to us about a pilotTrao đổi về thí điểm