Deterministic layer for AI agents

Context for the
agent era

A complete RAG system for the open web: search engine + site scraper in one platform. Use context.txt when available for deterministic answers, and fallback scraping when it is not.

<30ms responseDeterministic answers

How it works

A single text file gives AI agents everything they need. No scraping, no parsing, no wasted tokens.

01

Publish

Add /context.txt to your domain or upload structured context.txt from the dashboard. URL hosting is optional.

yourdomain.com/context.txt
02

Index

Submit your domain and we index every section. Sites without context.txt get auto-scraped via AI.

POST /submit
03

Search

AI agents query structured context in <30ms. MCP server, REST API, or n8n node.

GET /search?q=...

<30ms

Response time

vs ~200-500ms traditional RAG

~2K

Tokens consumed

vs high token use in full pipelines

High

Signal quality

publisher-curated content

Any site

Indexing

context.txt or AI fallback

RAG-oriented architecture

ProtoContext vs traditional RAG

ProtoContext is better when knowledge is structured and deterministic: products, prices, policies, docs, schedules. You get low-latency, exact answers from publisher-authored context. Traditional RAG still wins for massive unstructured corpora and deep semantic discovery.

Traditional RAG pipeline
01Ingest large unstructured content
02Chunk content into passages
03Normalize metadata and IDs
04Generate embeddings
05Store in vector database
06Retrieve + rerank
07Assemble probabilistic answer
~200-500ms latencyhigher infra overheadprobabilistic output
ProtoContext fast path
01
Website publishes context.txtplain text, structured
02
ProtoContext indexes itauto, instant
03
Agent queries the indexGET /search
04
Gets deterministic results<30ms, ~2K tokens
<30ms latency~2K tokensdeterministic

ProtoContext does not replace RAG; it makes it optional. Use ProtoContext as the deterministic fast path, then enable semantic search only when you actually need it. This keeps latency low while preserving a hybrid path for complex queries.

Structured first. Semantic when needed.

Extra

Multilingual support without duplicating everything

Publish one context file per language (for example /context.en.txt and /context.it.txt), while /context.txt keeps working exactly as-is for backward compatibility.

Initial language support (extra):

EnglishSpanishFrenchItalianGermanPortuguesePolishChineseFinnishSwedishNorwegianDanishJapanese
ProtoContextExtension (PCE)

Structured context for ecommerce, hotels, tours and more

PCE extends context.txt without breaking compatibility, so agents can understand what a site sells, answer FAQs consistently, and trigger safe actions.

What it enables

  • Understand inventory/services by vertical (hotel, ecommerce, tours, etc.)
  • Deliver consistent FAQ answers across agents
  • Trigger safe actions: availability checks, lead capture, booking redirects
  • Support multilingual content and seasonal updates

Conventions (without breaking ProtoContext)

  • Keep /context.txt fully compatible
  • Add optional metadata like @content_type and @location
  • Use normalized sections with repeatable blocks (products, rooms, rates, policies, tours)
  • PCX-Link rule: include DETAILS_URL plus an action URL (PURCHASE_URL or BOOKING_URL)

E-commerce — product links

PRODUCT_ID: sku_9876
NAME: Espresso Machine Pro
CATEGORY: kitchen_appliances
DETAILS_URL: https://shop.com/products/espresso-machine-pro
PURCHASE_URL: https://shop.com/checkout?product=sku_9876

Hotels — room links

ROOM_TYPE: superior_double
NAME: Superior Double Room
OCCUPANCY: 1-2
FEATURES: balcony, air conditioning, Wi-Fi
DETAILS_URL: https://hotel.com/rooms/superior
BOOKING_URL: https://booking.hotel.com?room=superior

Tours — activity links

TOUR_ID: tour_vespa_roma
NAME: Vespa Tour Roma
DURATION: 3 hours
LANGUAGES: en, it, es
DETAILS_URL: https://experiences.com/tours/vespa-roma
BOOKING_URL: https://experiences.com/book/tour_vespa_roma

API Reference

All endpoints available at your engine URL. Authenticate with x-proto-token header.

GET/search

Full-text search across all indexed sites

qstringrequiredSearch query
domainstringFilter by domain
limitintMax results (default 10)
curl "http://localhost:8000/search?q=payments&limit=5" \
  -H "x-proto-token: YOUR_TOKEN"

With AI provider:

curl "http://localhost:8000/search?q=payments" \
  -H "x-proto-token: YOUR_TOKEN" \
  -H "x-ai-key: YOUR_KEY" -H "x-ai-model: gemini/gemini-3-flash-preview"
GET/site

Get all context sections for a domain

domainstringrequiredDomain to retrieve
curl "http://localhost:8000/site?domain=stripe.com" \
  -H "x-proto-token: YOUR_TOKEN"
POST/submit

Submit a new domain to the index

domainstringrequiredDomain to register
ai_keystringAI provider key
ai_modelstringModel in provider/name format
curl -X POST http://localhost:8000/submit \
  -H "Content-Type: application/json" \
  -H "x-proto-token: YOUR_TOKEN" \
  -d '{"domain": "example.com"}'
POST/delete

Remove a domain from the index

domainstringrequiredDomain to delete
curl -X POST http://localhost:8000/delete \
  -H "Content-Type: application/json" \
  -H "x-proto-token: YOUR_TOKEN" \
  -d '{"domain": "example.com"}'
POST/batch

Multiple search queries in one request

queriesarrayrequiredArray of {q, domain?, limit?}
curl -X POST http://localhost:8000/batch \
  -H "Content-Type: application/json" \
  -H "x-proto-token: YOUR_TOKEN" \
  -d '{"queries": [{"q": "payments"}, {"q": "docs", "domain": "stripe.com"}]}'
GET/stats

Index statistics

curl http://localhost:8000/stats \
  -H "x-proto-token: YOUR_TOKEN"
GET/health

Health check

curl http://localhost:8000/health

Authentication

All protected endpoints require the x-proto-token header. Tokens are generated during setup or login.

GET/auth/status

Check authentication status and mode

curl http://localhost:8000/auth/status
POST/auth/setup

Create admin account (first run only)

namestringrequiredAdmin name
emailstringrequiredAdmin email
passwordstringrequiredMin 8 characters
curl -X POST http://localhost:8000/auth/setup \
  -H "Content-Type: application/json" \
  -d '{"name": "Admin", "email": "admin@example.com", "password": "securepass"}'
POST/auth/login

Sign in and receive session token

emailstringrequiredAccount email
passwordstringrequiredAccount password
curl -X POST http://localhost:8000/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "admin@example.com", "password": "securepass"}'
POST/auth/logout

Invalidate current session

curl -X POST http://localhost:8000/auth/logout \
  -H "x-proto-token: YOUR_TOKEN"

Supported AI Providers

Gemini

gemini/gemini-3-flash-preview

OpenAI

openai/gpt-4o-mini

OpenRouter

openrouter/google/gemini-3-flash-preview

Start in 30 seconds

Create a context.txt file, publish it on your domain, and your site is instantly readable by AI agents worldwide. No SDK, no API key, no signup.

yourdomain.com/context.txt
# Roma Coffee Shop
> Online store selling coffee machines and specialty beans

@lang: en
@version: 1.0
@updated: 2026-02-24
@topics: ecommerce, coffee, kitchen_appliances
@content_type: ecommerce
@location: Italy

## section: Product Catalog
PRODUCT_ID: sku_9876
NAME: Espresso Machine Pro
CATEGORY: kitchen_appliances
DETAILS_URL: https://shop.com/products/espresso-machine-pro
PURCHASE_URL: https://shop.com/checkout?product=sku_9876
AI-powered

Generate your context files

Copy this prompt into any AI (ChatGPT, Claude, Gemini) and paste your website content. It will output a properly formatted /context.txt plus optional language files like /context.es.txt and /context.en.txt, including simple PCE examples for PRODUCT_ID, ROOM_TYPE, and TOUR_ID.

context.txt generator prompt
You are a context file generator for the ProtoContext standard.
Your job is to convert website content (about pages, docs, catalog text, policies, FAQs) into clean AI-readable context files.

Output requirements:
- Always generate /context.txt
- If the source is multilingual, also generate /context.{lang}.txt files (example: /context.en.txt, /context.es.txt)
- Keep /context.txt backward compatible
- Supported language codes (initial): en, es, fr, it, de, pt, pl, zh, fi, sv, no, da, ja

Follow this exact format:

---
# Site Name
> One-line description of what this site/product/company does

@lang: [language code, e.g. en, es, fr]
@version: 1.0
@updated: [today's date in YYYY-MM-DD]
@topics: [comma-separated relevant topics]
@content_type: [optional, e.g. ecommerce, hospitality, tours]
@location: [optional city/country]

## section: About
[Plain text, concise, factual. Written for AI agents, not for marketing.]

## section: [Normalized Section Title]
[More plain factual content...]
---

If relevant, include repeatable structured blocks (ProtoContextExtension / PCE):

E-commerce example:
PRODUCT_ID: sku_9876
NAME: Espresso Machine Pro
CATEGORY: kitchen_appliances
DETAILS_URL: https://shop.com/products/espresso-machine-pro
PURCHASE_URL: https://shop.com/checkout?product=sku_9876

Hotel example:
ROOM_TYPE: superior_double
NAME: Superior Double Room
OCCUPANCY: 1-2
FEATURES: balcony, air conditioning, Wi-Fi
DETAILS_URL: https://hotel.com/rooms/superior
BOOKING_URL: https://booking.hotel.com?room=superior

Tour example:
TOUR_ID: tour_vespa_roma
NAME: Vespa Tour Roma
DURATION: 3 hours
LANGUAGES: en, it, es
DETAILS_URL: https://experiences.com/tours/vespa-roma
BOOKING_URL: https://experiences.com/book/tour_vespa_roma

Rules:
1. Each section starts with "## section: " followed by the title
2. Keep sections focused — one topic per section
3. Write in plain, factual language optimized for AI consumption
4. Remove HTML, markdown links, images, and formatting artifacts
5. Include metadata (@lang, @version, @updated, @topics) at the top
6. The first line is "# Site Name" followed by "> description"
7. Typical sections: About, Products/Services, Pricing, API, Documentation, Contact, FAQ
8. Keep each section under 500 words — be concise
9. Do NOT include navigation elements, footers, cookie notices, or UI text
10. Keep URLs explicit when actions are available (DETAILS_URL + PURCHASE_URL or BOOKING_URL)
11. Output plain text only, no markdown code fences
12. If multilingual output is requested, separate each file with a clear filename heading:
    FILE: /context.en.txt
    [file content]

Now convert the following website content into context files:

Copy the prompt, paste it into any AI, then paste your website content after it. Publish the output as yourdomain.com/context.txt