Agent recipe ยท 05

Long-context research agent

Turn a bounded document pack into a cited research brief with Kimi or Qwen. The key design choice is to preserve document boundaries and ask for evidence-backed claims.

Intermediate20 minutesEnglishVerified 2026-09-25
The live catalog currently lists kimi-k3 and qwen3.8-27b. Model availability and rates can change; check long-context notes and Models before a run.

1. The 60-second version

from openai import OpenAI
import os
client = OpenAI(base_url="https://aiwave.live/v1", api_key=os.environ["AIWAVE_API_KEY"])
documents = "[doc-1] Paste a bounded document here.\n[doc-2] Paste a second document here."
prompt = """Create a research brief with:
1. three findings,
2. one uncertainty,
3. citations in the form [doc-N].
Use only the supplied documents.

""" + documents
r = client.chat.completions.create(model="kimi-k3", messages=[{"role":"user","content":prompt}], max_tokens=900)
print(r.choices[0].message.content)

For a smaller document pack, swap kimi-k3 for qwen3.8-27b after checking current context and rate information.

2. Cost table

ModelIllustrative workloadToken estimate
kimi-k320,000 input + 1,000 outputabout $0.1125
qwen3.8-27b20,000 input + 1,000 outputabout $0.0161
SourceAIWave pricing, both rates effective 2026-08-27; checked 2026-09-25

3. Extension and errors

Next steps