Skip to main content

Dynamic Tool Retrieval Explained

Dynamic retrieval is the core innovation of Agent-CoreX. Instead of hardcoding tools, your agent requests tools at runtime based on the current task. This section explains how the ranking algorithm works.

The Retrieval Pipeline

When you query for tools, here’s what happens:

Step 1: Embedding Generation

Your query is converted to a dense vector (embedding) that captures semantic meaning.

How It Works

Why Embeddings?

Embeddings capture semantic similarity rather than exact keyword matching:
This is why Agent-CoreX understands:
  • Synonyms: “deploy” = “ship” = “release”
  • Misspellings: “deeploy” still matches
  • Paraphrasing: Long descriptions match specific queries

The embedding is searched against a vector database of all tools.

Vector Database

Agent-CoreX uses Qdrant for fast semantic search:

Search Algorithm

Search Performance


Step 3: Multi-Factor Ranking

Candidates are ranked using multiple signals:

The Ranking Formula

Factor 1: Embedding Similarity (40%)

Definition: How similar is the tool to your query?

Factor 2: Popularity (25%)

Definition: How often is this tool used across all users?
Why it matters: Popular tools are usually:
  • Well-tested and reliable
  • Have good documentation
  • Less likely to be buggy
  • Proven to work in production

Factor 3: User History (20%)

Definition: How likely are YOU to use this tool?
Example:
  • You’ve successfully deployed with deploy-aws 14/15 times → high boost
  • You’ve never used docker-build → no boost
  • You used slack-notify successfully → medium boost

Factor 4: Performance (15%)

Definition: How fast and reliable is this tool?

Complete Ranking Example

Let’s see the full process for a real query:

Query

Full Ranking Calculation

Tool 1: deploy-aws-ecs
Tool 2: slack-notify
Tool 3: deploy-kubernetes

Final Results


Advanced: Context-Aware Ranking

The ranking can be further influenced by context:

Temporal Factors

Workflow Context

Organizational Policy


Filtering & Constraints

You can constrain the search results:

Server Filter

Category Filter

Score Threshold


Optimization Strategies

1. Better Queries = Better Results

2. Multi-Step Retrieval

For complex workflows, retrieve tools in phases:

3. Caching Hot Tools


Monitoring Your Rankings

Check how tools are ranked for your queries:
Debug Response:

Next Steps

Tool Lifecycle

Learn how tools move through the system.

Tool Retrieval API

Detailed endpoint documentation.

Real Examples

See dynamic retrieval in action.

Optimization Guide

Token usage and performance tips.

Key Takeaway: Dynamic retrieval uses sophisticated AI-powered ranking to find the perfect tools for your task. The more specific your query, the better the results! 🚀