I built a lightweight design review agent that feeds technical proposals to Kimi K2 Thinking and returns a structured critique with explicit reasoning chains. It helps tech leads sanity check architecture decisions without scheduling another meeting. Because Oxlo.ai uses flat per-request pricing, sending long design docs does not inflate costs the way token-based billing would.
What you'll need
- An Oxlo.ai API key from https://portal.oxlo.ai
- Python 3.10 or newer
- The OpenAI SDK:
pip install openai
Step 1: Configure the Oxlo.ai client
I start by instantiating the OpenAI SDK with Oxlo.ai's base URL so every call routes to Kimi K2 Thinking. This is a drop-in replacement, so the only difference from OpenAI's client is the endpoint and model name.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.oxlo.ai/v1",
api_key=os.environ.get("OXLO_API_KEY")
)
response = client.chat.completions.create(
model="kimi-k2-thinking",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Confirm connectivity."},
],
)
print(response.choices[0].message.content)
Step 2: Define the system prompt
Kimi K2 Thinking shines when you force it to externalize its reasoning. I use a system prompt that requires the model to walk through tradeoffs before giving a final verdict.
SYSTEM_PROMPT = """You are a senior staff engineer conducting a design review.
When you receive a technical proposal, think step by step through the following:
1. Restate the core problem and constraints.
2. Identify at least three architectural tradeoffs.
3. List concrete risks (performance, security, maintenance).
4. Propose two alternative approaches.
5. Give a final recommendation with clear reasoning.
Format your response with clear headers for each section."""
Step 3: Build the review function
Next I wrap the API call in a function that accepts a raw proposal string, injects the system prompt, and returns the analysis. Keeping this in a pure function makes it easy to drop into a FastAPI route or a CLI later.
def review_proposal(proposal_text: str) -> str:
user_message = f"Review this proposal:\n\n{proposal_text}"
response = client.chat.completions.create(
model="kimi-k2-thinking",
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_message},
],
)
return response.choices[0].message.content
Run it
I pass a realistic migration proposal to the agent and print the returned analysis. In my terminal, the response arrives in one completion because Oxlo.ai serves Kimi K2 Thinking without cold starts.
if __name__ == "__main__":
proposal = """
Proposal: Migrate our monolithic REST API to GraphQL over the next quarter.
Rationale: Frontend teams want to fetch nested resources in one round trip.
Plan: Deploy a single GraphQL gateway in front of existing REST services.
"""
analysis = review_proposal(proposal)
print(analysis)
Example output:
## Core Problem and Constraints
The team wants to reduce round trips between frontend and backend by adopting GraphQL. The timeline is one quarter, and the plan wraps existing REST services behind a gateway.
## Architectural Tradeoffs
1. **N+1 queries**: GraphQL resolvers can trigger cascading requests to downstream REST endpoints if not batched.
2. **Caching complexity**: HTTP caching at the edge works poorly with POST-based GraphQL queries compared to cacheable REST URLs.
3. **Team expertise**: The backend team is fluent in REST semantics but has limited GraphQL production experience.
## Concrete Risks
- **Performance**: A single complex GraphQL query could fan out into dozens of internal REST calls, increasing latency.
- **Security**: Query depth and complexity limits must be implemented to prevent resource exhaustion.
- **Maintenance**: The gateway becomes a single point of failure and requires its own deployment pipeline.
## Alternative Approaches
1. **BFF pattern**: Build backend-for-frontend services that aggregate REST calls server-side without exposing GraphQL.
2. **Partial GraphQL**: Introduce GraphQL only for the heaviest nested read paths while keeping REST for mutations.
## Final Recommendation
I recommend the partial GraphQL approach. It delivers the frontend efficiency gains with lower blast radius than a full migration, and it gives the team time to build operational expertise before committing the entire platform.
Wrap-up
You can extend this agent by wiring it to a Slack bot so engineers submit proposals via a slash command. You could also add a second pass that asks Kimi K2 Thinking to score each risk on impact and likelihood, then store the results in a Notion database for tracking.
Top comments (0)