Skip to main content
POST /api/v1/context/retrieve

Core Concepts

Persistent Memory

Long-term storage referenced via memory_id . Backed by the Unified 8-Operator Surface .

Context

Assembled data passed via context object. Token-budget-aware context assembly for LLM system prompts via POST /api/v1/context/retrieve .

Users & Sessions

Scoped via user_id identifiers. Enterprise multi-tenancy enforced via strict namespace isolation ( X-Namespace-Prefix header) and automated PHI/PII privacy redaction.

Retrieval

Query via client.search() . Hybrid search engine combining dense vector similarity (HNSW via pgvector ) and BM25 trigram full-text search, fused using Reciprocal Rank Fusion ( RRF_K=30 ).

Knowledge

Structured domain data accessible through knowledge.query() . PiyGraph Knowledge Graph tracking real-world validity ( valid_at ) separately from system recording time ( system_at ).

Architecture

PiyAPI decouples cognitive and storage workloads to deliver sub-millisecond retrieval alongside durable state management across millions of concurrent users.

Initialize the Client

Connect to PiyAPI through our official SDKs or raw REST requests. Supply your API key generated from the dashboard.

Store and Retrieve Context

A typical lifecycle integrates continuous memory persistence with targeted contextual recall before each model completion:

How PiyAPI Works

The five-stage pipeline transforms raw multi-turn dialogue into high-signal context vectors with bitemporal validity:

What’s Next?