Integration Guide
Learn how to integrate Agentify API into your AI agent in 15 minutes
π Table of Contents
π― Why Agentify?
In the Zero-Click Economy, AI agents are the new gatekeepers. Users ask questions, AI agents find answersβoften without users ever clicking a link. If your products aren't AI-discoverable, they're invisible.
β The Problem
- Generic product descriptions don't match AI agent queries
- No trust signals β AI agents skip your products
- Missing semantic tags β Poor intent matching
- Inconsistent data β AI can't make recommendations
β The Agentify Solution
- Multi-Agent Validation: Every product audited by 3 LLMs (Gemini, Claude, ChatGPT)
- Transparent Trust Scores: 0-1 score with detailed breakdown (extraction, audit, human verification)
- Semantic Tags: Product specialty, user profiles, decision hints
- Decision-Ready Format: Pre-structured for AI consumption, no post-processing
- GPC Taxonomy: Standardized classification aligned with global standards
ποΈ Cost-Transfer Architecture
Unlike traditional search APIs, Agentify uses a cost-efficient architecture where you compute embeddings once, and we handle all the infrastructure complexity.
π‘ Economic Model: You Pay for Embeddings, We Handle the Rest
Your Side (One-Time Cost)
- β Generate embedding vector
- β ~$0.00002 per query (OpenAI text-embedding-3-small)
- β Can cache for identical queries
Our Side (Infrastructure)
- β Qdrant vector database
- β Hybrid filtering engine
- β Multi-agent validation system
- β Semantic enrichment pipeline
Result: You save on infrastructure costs while getting production-grade search capabilities and validated data.
π Architecture Flow
βββββββββββββββββββ
β Your AI Agent β
ββββββββββ¬βββββββββ
β 1. User query: "eco-friendly water bottle"
βΌ
βββββββββββββββββββββββββββββββ
β Embedding Model (OpenAI) β β You compute this
ββββββββββ¬βββββββββββββββββββββ
β 2. Vector [0.023, -0.145, 0.891, ...]
βΌ
βββββββββββββββββββββββββββββββ
β POST /vector-search β
β { q_vector: [...] } β β Agentify API
ββββββββββ¬βββββββββββββββββββββ
β 3. Semantic search + Multi-agent validation
βΌ
βββββββββββββββββββββββββββββββ
β Decision-Ready DPPAs β
β with trust scores 0.85+ β β AI-consumable format
ββββββββββββββββββββββββββββββββ‘ 5-Minute Quickstart
Step 1: Install OpenAI SDK
npm install openai
Step 2: Test with Example Query
import OpenAI from 'openai';
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
async function searchProducts(query: string) {
// 1. Generate embedding from user query
const embedding = await openai.embeddings.create({
model: "text-embedding-3-small",
input: query,
});
// 2. Search Agentify with the vector
const response = await fetch('https://agentify-v3.vercel.app/api/dpp/v1/vector-search', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
q_vector: embedding.data[0].embedding,
limit: 10,
filter: {
minTrustScore: 0.7 // Only high-quality products
}
})
});
const results = await response.json();
return results;
}
// Try it!
const products = await searchProducts("eco-friendly portable water bottle for hiking");
console.log(products.results);β You're done!
You now have semantic product search with AI-validated data and trust scores.
π§ Generating Embeddings
Agentify expects 1536-dimensional vectors from OpenAI's text-embedding-3-small model. This is the same model we use internally, ensuring semantic alignment.
β οΈ Important: Use the Same Model
Different embedding models create incompatible vector spaces. Always use text-embedding-3-small for best results.
Supported Platforms
Node.js / TypeScript
import OpenAI from 'openai';
const client = new OpenAI();
const emb = await client.embeddings.create({
model: "text-embedding-3-small",
input: query
});Python
from openai import OpenAI client = OpenAI() response = client.embeddings.create( model="text-embedding-3-small", input=query )
π° Cost Optimization
- Cache embeddings for identical queries (Redis, in-memory)
- Batch similar queries together
- ~$0.00002 per request with text-embedding-3-small
- Much cheaper than running your own vector database
π Vector Search API
Request Format
POST /api/dpp/v1/vector-search
Content-Type: application/json
{
"q_vector": [0.023, -0.145, 0.891, ... (1536 floats)],
"limit": 10,
"filter": {
"category": "Sports & Outdoors", // Optional
"minPrice": 10, // Optional
"maxPrice": 100, // Optional
"minTrustScore": 0.7, // Optional
"brand": "HydroTech" // Optional
}
}Response Format
{
"results": [
{
"id": "674a1b2c3d4e5f6a7b8c9d0e",
"score": 0.89, // Cosine similarity (0-1, higher = better match)
"dppa": {
"title": "EcoFlow Water Bottle 750ml",
"brand": "HydroTech",
"price": { "value": 24.99, "currency": "EUR" },
"category": "Sports & Outdoors",
// Trust & Validation
"ai:trustScore": 0.85,
"ai:trustBreakdown": {
"sourceExtraction": 0.8,
"sourceAudit": 0.9,
"sourceHuman": 0.85,
"fieldCompleteness": 0.8,
"dataConsistency": 0.9
},
// Semantic Tags
"ai:productSpecialty": [
"PortableHydration",
"EcofriendlyDesign",
"Durable"
],
"agentify:matching.userProfile": [
"sportifs_actifs",
"eco_conscious",
"outdoor_enthusiasts"
],
"agentify:agent.decisionHints.bestFor": [
"outdoor_activities",
"sports_training",
"daily_commute"
],
// Actions
"ai:actions": {
"buyUrl": "https://example.com/product/123"
},
// Additional Data
"gpc": {
"brickCode": "10005948",
"brickName": "Water Bottles",
"segment": "Sports Equipment",
"family": "Hydration"
},
"images": ["https://..."],
"availability": "in_stock"
}
}
],
"total": 1,
"limit": 10,
"processingTime": "142ms"
}π‘ Understanding Trust Score
The ai:trustScore is calculated with this formula:
trustScore = (0.2 Γ extraction) + (0.3 Γ audit) + (0.2 Γ human) + (0.15 Γ completeness) + (0.15 Γ consistency)Use minTrustScore: 0.7 filter to get only high-quality products
π Using the Dictionary
The dictionary is your semantic contract with Agentify. It defines the official vocabulary, taxonomies, and scoring rules.
Discovering Valid Tags
GET /api/dpp/v1/meta/dictionary
// Response includes:
{
"tags": {
"ai:productSpecialty": [
{
"tag": "EcofriendlyDesign",
"synonyms": ["eco", "sustainable", "green"],
"usageCount": 23
},
...
]
},
"metrics": {
"ai:trustScore": {
"description": "Overall quality score (0-1)",
"components": [
{ "name": "sourceExtraction", "weight": 0.2 },
{ "name": "sourceAudit", "weight": 0.3 },
...
]
}
}
}Fuzzy Search for Tags
GET /api/dpp/v1/meta/dictionary?search=urban
// Finds: "UrbanStyle" and all synonyms
{
"query": "urban",
"results": [
{
"tag": "UrbanStyle",
"synonyms": ["urban_style", "street", "city_wear"],
"usageCount": 15
}
]
}π Dynamic Growth
The dictionary grows as the catalog expands. Check /api/dpp/v1/meta/dictionary/statsto see new tags and trending products.
π» Complete Code Examples
Example 1: E-Commerce Chatbot
// Scenario: User asks "I need a gift for an eco-conscious runner"
import OpenAI from 'openai';
const openai = new OpenAI();
async function findGiftForRunner(userMessage: string) {
// 1. Generate embedding
const embedding = await openai.embeddings.create({
model: "text-embedding-3-small",
input: userMessage
});
// 2. Search with semantic + profile filters
const response = await fetch('/api/dpp/v1/vector-search', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
q_vector: embedding.data[0].embedding,
limit: 5,
filter: {
minTrustScore: 0.8, // High quality only
category: "Sports & Outdoors"
}
})
});
const { results } = await response.json();
// 3. Filter by semantic tags
const ecoRunnerProducts = results.filter(r =>
r.dppa['agentify:matching.userProfile'].includes('eco_conscious') &&
r.dppa['agentify:matching.userProfile'].includes('sportifs_actifs')
);
return ecoRunnerProducts;
}
// Returns products like:
// - Biodegradable Running Water Bottle
// - Eco-Friendly Athletic Socks
// - Sustainable Fitness TrackerExample 2: Product Recommendation Engine
// Scenario: Recommend complementary products
async function getComplementaryProducts(productId: string) {
// 1. Get original product
const product = await fetch(`/api/dpp/v1/full-dpp/${productId}`)
.then(r => r.json());
// 2. Use its tags to find similar
const tags = product['ai:productSpecialty'].join(' ');
const embedding = await openai.embeddings.create({
model: "text-embedding-3-small",
input: tags
});
// 3. Search with same category
const results = await fetch('/api/dpp/v1/vector-search', {
method: 'POST',
body: JSON.stringify({
q_vector: embedding.data[0].embedding,
filter: {
category: product.category,
minTrustScore: 0.7
}
})
}).then(r => r.json());
return results.results.filter(r => r.id !== productId);
}β Best Practices
1. Always Filter by Trust Score
Use minTrustScore: 0.7 to ensure high-quality results. Scores below 0.5 may have incomplete or unvalidated data.
2. Cache Embeddings
Identical queries produce identical embeddings. Cache them to save costs.
const cache = new Map(); if (cache.has(query)) return cache.get(query); const emb = await generateEmbedding(query); cache.set(query, emb);
3. Use Hybrid Filtering
Combine semantic search with hard filters (category, price) for better precision.
4. Check Dictionary Regularly
New tags are added as the catalog grows. Query /meta/dictionary/statsto discover trending products and emerging categories.
5. Handle Empty Results
If no results match, relax filters (lower minTrustScore, remove category) and re-query with broader criteria.
Ready to Make Your Products AI-Discoverable?
Start building with Agentify API today. Full OpenAPI spec available.