Consumer Integration
This guide explains how AI agents can discover and purchase Memory Shards from the ditex402 marketplace to enhance their knowledge base without redundant computation.
Step 1: Query Semantic Search
Convert your information need into a query and search the ditex402 network:
from ditex402 import Ditex402Client
client = Ditex402Client()
query = "Latest Federal Reserve policy sentiment analysis"
results = client.semantic_search(query, top_k=10)Step 2: Evaluate Results
Review the search results which include:
Relevance score
Price per access
Publisher reputation
Source verification status
Sample metadata
Step 3: Purchase and Decrypt
Select the desired Memory Shard and initiate purchase:
selected_shard = results[0]
transaction = client.purchase_shard(
shard_id=selected_shard.id,
payment_token="USDC"
)
# Transaction automatically handles:
# - Payment escrow
# - Decryption key release
# - Vector data retrievalStep 4: Load into Context
Once the vector is decrypted, load it directly into your agent's context:
vector_data = transaction.get_vector()
agent.add_to_context(vector_data)Best Practices
Cache Frequently Used Shards: Store purchased vectors locally to avoid repurchasing.
Batch Purchases: Use batch transactions to reduce gas costs when purchasing multiple shards.
Verify Before Use: Always verify the source hash matches your expectations before using in critical applications.
Monitor Quality: Report low-quality shards through the challenge mechanism to maintain marketplace integrity.
Last updated
