Skip to content

Yapay Zeka Belleği

Yapay zekanın oturumlar arasında bağlamı korumak için kullandığı kalıcı bellek girişleri.

Uç noktalar

MethodPathDescriptionAuthRate Limit
GET/ai/memoryList memoriesJWT + Entitlement60/min
POST/ai/memoryCreate a memory entryJWT + Entitlement30/min

GET /ai/memory

İsteğe bağlı olarak kapsama göre filtrelenmiş bellek girişlerini listeleyin.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 60/dak

Rica etmek

ParameterTypeRequiredDescription
scopestringNoFilter by scope: user, session, chain, workspace
originstringNoFilter by origin: user, inferred, imported, system
confidencestringNoFilter by confidence: low, medium, high
freshnessstringNoFilter by freshness: active, stale, archived
chainyIdstringNoFilter by Chainy ID (UUID)
typestringNoFilter by memory type: preference, context, behavioral, goal

Cevap

Yanıt Örneği
json
{
  "data": [
    {
      "id": "cm5mem01",
      "content": "User prefers morning study sessions between 7-9 AM.",
      "scope": "user",
      "tags": ["preferences", "learning-style"],
      "type": "preference",
      "origin": "user",
      "confidence": "high",
      "freshness": "active",
      "chainyId": null,
      "importance": 75,
      "createdAt": "2026-03-17T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 1
  }
}
Yanıt Alanları
FieldTypeDescription
idstringMemory ID
contentstringMemory content
scopestringuser, session, chain, workspace
tagsstring[]Tags
typestring | nullMemory type: preference, context, behavioral, goal
originstring | nullMemory origin: user, inferred, imported, system
confidencestring | nullConfidence level: low, medium, high
freshnessstringMemory freshness: active, stale, archived
chainyIdstring | nullLinked Chainy ID
importancenumberImportance score (0-100)
createdAtstringISO 8601

Kod Örnekleri

bash
curl "https://api.chainabit.com/api/v1/ai/memory?scope=user" \
  -H "Authorization: Bearer $TOKEN"
javascript
const params = new URLSearchParams({ scope: "user" });
const res = await fetch(`${BASE_URL}/ai/memory?${params}`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data, meta } = await res.json();
python
import requests

res = requests.get(
    f"{BASE_URL}/ai/memory",
    headers={"Authorization": f"Bearer {TOKEN}"},
    params={"scope": "user"},
)
body = res.json()

POST /ai/memory

Yeni bir hafıza girişi oluşturun.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 30/dak

Rica etmek

FieldTypeRequiredConstraintsDescription
contentstringYesNon-empty, max 10,000 charsMemory content
scopestringYesuser, session, chain, workspaceScope for this memory
scopeIdstringNoID of the scoped entity
tagsstring[]NoTags for categorization
originstringNouser, inferred, imported, systemMemory origin. Defaults to user
confidencestringNolow, medium, highConfidence level. Defaults to medium
evidencestring[]NoMax 20 items, each max 2,000 charsSupporting evidence for this memory
sourceEntityTypestringNochainy, chain, bit, sessionType of the source entity
sourceEntityIdstringNoUUIDID of the source entity
chainyIdstringNoUUIDLinked Chainy ID
typestringNopreference, context, behavioral, goalMemory type

Cevap

Yanıt Örneği
json
{
  "data": {
    "id": "cm5mem01",
    "content": "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
    "scope": "user",
    "scopeId": null,
    "tags": ["preferences", "learning-style"],
    "type": "preference",
    "origin": "user",
    "confidence": "medium",
    "freshness": "active",
    "chainyId": null,
    "importance": 50,
    "createdAt": "2026-03-17T10:00:00.000Z"
  }
}
Yanıt Alanları
FieldTypeDescription
idstringMemory ID
contentstringMemory content
scopestringuser, session, chain, workspace
scopeIdstring | nullScoped entity ID
tagsstring[]Tags
typestring | nullMemory type: preference, context, behavioral, goal
originstring | nullMemory origin: user, inferred, imported, system
confidencestring | nullConfidence level: low, medium, high
freshnessstringMemory freshness: active, stale, archived
chainyIdstring | nullLinked Chainy ID
importancenumberImportance score (0-100)
createdAtstringISO 8601

Kod Örnekleri

bash
curl -X POST https://api.chainabit.com/api/v1/ai/memory \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
    "scope": "user",
    "tags": ["preferences", "learning-style"]
  }'
javascript
const res = await fetch(`${BASE_URL}/ai/memory`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    content:
      "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
    scope: "user",
    tags: ["preferences", "learning-style"],
  }),
});
const { data } = await res.json();
python
import requests

res = requests.post(
    f"{BASE_URL}/ai/memory",
    headers={
        "Authorization": f"Bearer {TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "content": "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
        "scope": "user",
        "tags": ["preferences", "learning-style"],
    },
)
data = res.json()["data"]

Bellek Taksonomisi

Her hafıza girişi çeşitli boyutlara göre sınıflandırılır:

Kapsam

Hafızanın geçerli olduğu yer.

ValueDescription
userAccount-wide — applies across all sessions and chains
sessionSession-scoped — relevant only within a specific session
chainChain-scoped — tied to a specific chain
workspaceWorkspace-scoped — shared across a workspace
chainyChainy-scoped — tied to a specific Chainy

Tip

Nasıl bir hafıza.

ValueDescription
preferenceUser preferences
contextSituational context
behavioralObserved patterns
goalExplicit goals

Menşei

Bellek nasıl oluşturuldu?

ValueDescription
userExplicitly created by the user
inferredAI-derived from interactions
importedImported from an external source
systemPlatform-generated by the system

Tazelik Yaşam Döngüsü

Anılar zaman içinde tazelik durumlarıyla ilerler:

"etkin" → "eski" → "arşivlendi"

ValueDescription
activeCurrent and relevant
staleNot recently accessed or updated — may need review
archivedNo longer active — retained for history

Kendinden emin

Belleğin ne kadar güvenilir olduğu kabul edilir.

ValueDescription
lowUncertain — may need verification
mediumReasonable confidence
highWell-established and verified

İçerik Doğrulaması

INFO

Bellek içeriği depolamadan önce doğrulanır. Doğrulamada başarısız olan istekler 400 Hatalı İstek yanıtı döndürür.

  • Maksimum içerik uzunluğu: 10.000 karakter
  • Hızlı enjeksiyon: İçerik, hızlı enjeksiyon modellerine göre doğrulanır ve şüpheli olması durumunda reddedilir
  • Boş bayt: Boş bayt (\0) içeren içerik reddedilir
  • Boş içerik: "İçerik" alanı boş olmamalıdır

Built with purpose.