How an Indie Agent Framework Cuts Costs with Three Design Decisions
A deep dive into the three core design choices of an independently maintained agent orchestration framework: a two-tier main/tool model split, persistent cross-session memory, and unified multi-agent scheduling—along with reusable tuning parameters, cost measurement methods, and practical caveats for implementation.
Three Design Decisions That Keep Agent Costs Down
The development cost of agent systems is typically eaten up by two things: calling a flagship model at every step, and repeatedly paying for ever-growing context. An orchestration framework (Harness) maintained by an independent developer offers designs worth examining on both fronts. Rather than repeating the rankings and specific numbers circulating online, this article focuses on three core designs, the reusable ideas behind them, and the boundaries to watch when implementing them.
The Benchmark First: Trust the Conclusions, Verify the Numbers
A third-party evaluation team once compared more than twenty mainstream agent orchestration solutions across task completion rate, stability, and per-unit cost. This framework ranked near the top, with competitive unit costs. However, the specific figures circulating publicly usually lack a complete methodology. Sample size, task set composition, model API pricing versions, and measurement windows all significantly affect results. Before citing any ranking or cost data, find the original benchmark report and verify these details.
When calculating unit cost, use a consistent formula: unit cost equals total spend divided by the number of successfully completed tasks. Looking only at per-call prices fails to capture the hidden overhead of failed retries.
Design 1: Tiering the Main Model and Tool Model
The core idea is to route reasoning-heavy steps to a main model and mechanical steps—parsing, extraction, search—to a lightweight tool model. This reduces flagship model calls while preserving the quality of key decisions.
Below is a configuration example that illustrates the structure. Parameters must be adjusted for your own provider and model versions; these do not represent the framework’s defaults.
- main_model: A flagship model with strong reasoning, used for task planning, code modifications, and final judgments.
- tool_model: A cheap small model, used for JSON parsing, web page content extraction, and keyword generation.
- fallback: When the tool model fails structural validation twice in a row, escalate that step to the main model automatically, and log the fallback event for later analysis.
The boundary for tool model selection is clear: steps requiring strict output formats, steps involving code logic judgments, and steps where errors are costly should all go to the main model.
To measure the effect of tiering, run “single model” and “tiered” configurations on the same batch of tasks, record total token costs, task success rate, and average latency, then compute cost per successful task. As a starting point: if tiering drops the success rate by more than 5 percentage points, the tool model is handling steps it shouldn’t, and those steps should be moved back to the main model.
Design 2: Long-Term Memory That Accumulates Across Sessions
The framework’s memory pipeline has five steps: extract key information, vectorize and store it, rewrite the current query, retrieve similar memories, and inject threshold-filtered results into the prompt. Compared to relying solely on the current conversation window, this lets an agent carry over project structure, user preferences, and established conventions into future sessions.
When implementing, the following parameters are reasonable starting points, to be tuned against real query samples from your scenario:
- Embedding model: For primarily Chinese content, prioritize models with strong Chinese support. Fix the model version—switching models requires rebuilding the entire index.
- Vector storage: For small-to-medium datasets, a local vector index works. For larger volumes or per-project/per-user filtering, choose a service that supports metadata filtering.
- Similarity threshold: Start at 0.75. Take a batch of manually labeled queries, check whether retrieved results are relevant, then adjust incrementally.
- Top_k (number of recalled items): Start with 5. Too many items consume context window and increase model costs.
- Retention period: Keep project memories for 90 days, then archive or delete. Store user preferences separately, and allow users to clear them at any time.
Long-term memory also introduces risks that need handling upfront:
- Privacy: Memories may contain keys, personal information, or customer data. Sanitize before writing; keys and passwords should never enter the memory store.
- False recalls: With a threshold set too low, irrelevant history gets injected into prompts, potentially misleading the model with outdated decisions. Log the memory IDs injected each time to make troubleshooting easier.
- Extra costs: Query rewriting and memory extraction require additional model calls; factor this into total cost.
- Deletion mechanism: Provide interfaces for deleting memories by user and by project. Deletion must also clear vector indexes and backup copies.
Design 3: Unified Multi-Agent Scheduling
The framework places multiple agents in a single interface and divides sessions into three states: running, completed, and requiring human intervention. Developers don’t need to switch between multiple terminals—checking the status panel is enough to track each subtask’s progress.
The value of unified scheduling lies in task orchestration and state management, not just interface consolidation. Implementation requires handling these issues:
- Task conflicts: When two agents modify the same file simultaneously, the scheduling layer should acquire a file lock first, or scope tasks by directory to prevent overwriting each other.
- Permission isolation: Each agent gets only the minimum permissions needed for its task. For example, a frontend agent should not be able to read production database credentials.
- Failure retries: Network errors and timeouts can retry automatically—3 attempts maximum, with exponential backoff. Business errors like failed tests should not be retried blindly; hand them to a human instead.
- Result passing: Upstream agents should output structured results—for example, JSON containing a file list, change summary, and outstanding items. Downstream agents read by structure rather than parsing natural language.
For compatibility scope and onboarding steps, defer to the framework’s official documentation. Docs update frequently—don’t rely on secondhand sources to judge whether an agent is supported.
Comparing Three Configuration Options
| Configuration | Best for | Unit cost | Main risk |
|---|---|---|---|
| Single flagship model | Few tasks, extremely high quality requirements | High | Costs grow linearly with step count |
| Main model + tool model | Many steps, high proportion of mechanical operations | Medium-low | Unstable tool model output; requires fallback mechanism |
| Main + tool model + long-term memory | Long-running projects with repeated context | Medium | False recalls; privacy and data retention management |
Unit cost here is a qualitative comparison. Actual values must be measured against your own task set.
Implementation Checklist
- Build a test set from 20–50 of your own real tasks.
- Measure cost per successful task, task success rate, and average latency separately.
- Assign minimum permissions to each agent.
- Sanitize data before writing memories, and set retention periods.
- Log every fallback, retry, and memory injection.
Who Should Read This, and What to Keep in Mind
This article is for AI application developers, tech leads, and individual developers looking to reduce API spend. It offers design principles and parameter starting points—not ready-made optimal configurations.
The framework is still iterating rapidly, and both features and rankings will change. When benchmark numbers lack a documented methodology, they should not be used directly for procurement or technology selection decisions.
