SDK
Drop-in SDKs for TypeScript and Python. Add persistent memory to any LLM application in minutes.
Cortyxia SDKs follow the same chat-completion interface you already use. Install the package, set ISO_URL and ISO_TOKEN in a .env file, and instantiate the client. Existing calls automatically gain persistent memory, context optimization, and cross-provider routing.
The SDK handles memory retrieval, context compression, and provider switching behind the same chat.completions.create method you already use. You do not rewrite prompts or change response parsing. Memory is injected at the proxy layer, so your application stays simple while your LLM gets smarter.
This is useful for any application that talks to an LLM more than once for the same user or task. Without a memory layer, every request starts from zero. The model forgets the customer, the project, the codebase, and the conversation from five minutes ago. Cortyxia fixes that by retrieving the right context and injecting it before the request reaches the provider. You keep the same prompt shape, response format, and provider behavior.
The bridge sits between your code and the provider, adding memory, observability, and token optimization on the way through. It does not replace the model or change how you parse the response. Your existing streaming handlers, UI components, and provider logic keep working.
For full installation, migration, and API details, read the SDK Guide.
Supported languages
TypeScript / Node.js
npm install cortyxia
One-shot setup
# .envISO_URL=https://app.cortyxia.comISO_TOKEN=<ISO_TOKEN>
Basic usage
1import { Cortyxia } from "cortyxia";23const client = new Cortyxia({4 isoUrl: process.env.ISO_URL || "https://app.cortyxia.com",5 isoToken: process.env.ISO_TOKEN6});78const response = await client.chat.completions.create({9 model: "<MODEL_NAME>",10 messages: [{ role: "user", content: "What did we discuss last week?" }]11});1213console.log(response.choices[0].message.content);
Python
pip install cortyxia
One-shot setup
# .envISO_URL=https://app.cortyxia.comISO_TOKEN=<ISO_TOKEN>
Basic usage
1from cortyxia import Cortyxia23client = Cortyxia(4 iso_url="https://app.cortyxia.com",5 iso_token="<ISO_TOKEN>"6)78response = client.chat.completions.create(9 model="<MODEL_NAME>",10 messages=[{"role": "user", "content": "What did we discuss last week?"}]11)1213print(response["choices"][0]["message"]["content"])
How memory injection works
1. Ingest
Every request is processed through the proxy and stored in the memory graph. You can also add facts manually with client.memory.add.
2. Retrieve
Before a request is sent to the provider, the proxy queries the memory layer using BM25, semantic reranking, and temporal context. Only the most relevant nodes are returned.
3. Inject
The retrieved context is inserted into the prompt. The final request is then sent to the provider configured for your ISO key. The model sees the right context without prompt engineering.
The memory layer is project-scoped. Each ISO key encodes a project namespace and a shared/private flag, so retrieval never leaks across tenants even when the same physical store is used.
Why use the SDK?
Drop-in replacement
OpenAI-compatible chat completion signatures. Change the import, keep your prompts and response parsing.
Automatic memory injection
Relevant memory nodes are retrieved and injected into every request without changing your prompts.
Observability
Access dashboard metrics and knowledge-debt reports through the SDK's observability namespace.
Model agnostic
One ISO key routes to the provider and model configured for your project. Use any provider Cortyxia supports.
Use cases
Long-running agents
Build agents that work across multiple sessions. The agent remembers the user, the task history, and the decisions it made yesterday, so it can continue without a fresh brief.
SaaS assistants
Give every tenant a persistent memory namespace. The assistant recalls preferences, prior tickets, and account details without you building a custom database layer.
Multi-provider apps
Use the same memory-backed request shape across providers. The memory layer stays the same regardless of which provider answers the call.
Knowledge debt tracking
Use client.observability.knowledgeDebt to find queries that should have hit memory but did not. This tells you exactly what facts to seed into the system.
ISO keys and namespaces
An ISO key is the credential that an application or CLI agent uses to route requests through Cortyxia. The key encodes the project namespace and a shared/private scope, so retrieval is always isolated to the right tenant. You create and manage keys in the Cortyxia dashboard or cloud API, not through the SDK.
Use shared keys when multiple agents or applications should read from the same project memory. Use private keys when a key needs its own isolated namespace inside the same project. The model and provider are configured on the key itself, so the application only needs to pass the ISO token and model name.
Dev-mode keys are useful for local agents or experiments. They use a separate namespace inside the same project, so an agent cannot pollute production memory while still sharing the same project settings.
Resources
Ready to integrate?
Get the full SDK reference, environment setup, memory operations, and migration examples in the documentation.