Rensei docs
Memory

Memory Export

JSON-LD/CSV/MD export.

Partial Implementation. Core export formats (JSON-LD, CSV, Markdown) are shipped. Cedar policy filtering, retention policy enforcement, and compliance artifact generation are still in progress.

Memory Export allows you to download your organization's learned observations in multiple formats for compliance, backup, analysis, or knowledge sharing. Exports are scoped by organization, project, and work type.

Export Formats

JSON-LD (Linked Data)

Use for: System integration, semantic analysis, RDF triple stores, knowledge graphs.

Structure:

{
  "@context": "https://rensei.ai/contexts/memory-v1",
  "@type": "MemoryExport",
  "exportedAt": "2026-05-15T10:30:00Z",
  "organization": "org_abc",
  "observations": [
    {
      "@id": "obs_abc123",
      "@type": "Observation",
      "content": "Use React hooks for state management",
      "type": "coding-pattern",
      "confidence": 0.96,
      "weight": 0.94,
      "sourceAgent": "agent-research",
      "createdAt": "2026-05-10T08:15:00Z",
      "corroborationCount": 5,
      "metadata": {
        "domain": "frontend",
        "tags": ["react", "state-management"]
      }
    }
  ]
}

Recommended for:

  • Publishing observations to a central knowledge graph
  • Importing into external semantic analysis tools
  • Compliance/archival systems that support RDF

CSV

Use for: Spreadsheet analysis, bulk tagging, external ML pipelines, audit reports.

Columns:

id,agent,project,timestamp,classification,content_hash,feedback_weight,content
obs_abc123,agent-research,proj_frontend,2026-05-10T08:15:00Z,internal,a3f4e2...,0.94,"Use React hooks for state management"

Advantages:

  • Easy to filter/sort in Excel or Google Sheets
  • Works with BI tools (Tableau, Looker, etc.)
  • Human-readable; good for manual review

Markdown

Use for: Documentation, wikis, readability, knowledge base publishing.

Structure:

# Memory Export - Organization ABC

Exported: 2026-05-15T10:30:00Z
Total observations: 142

## Coding Patterns (53 observations)

### Frontend Development (18)
- **Use React hooks for state management**
  - Confidence: 96% | Weight: 0.94 | Corroborated by 5 agents
  - Last updated: 2026-05-10T08:15:00Z
  - Domain: frontend

### API Design (15)
...

Advantages:

  • Readable in GitHub, wikis, or Notion
  • Easy to embed in runbooks
  • Version control friendly

Filters

When exporting, you can filter by:

FilterExampleEffect
projectIdproj_abcOnly observations from this project (null = org-wide)
workTypedev, qaOnly observations created during specific work types
sinceDate2026-05-01T00:00:00ZOnly observations created after this date
minConfidence0.8Only observations with confidence ≥ threshold
minWeight0.6Only observations with final weight ≥ threshold
tags["security", "performance"]Only observations matching any tag
domain["frontend", "backend"]Only observations matching domain metadata
onlyCorroboratedtrueOnly observations confirmed by 2+ agents

Example:

Export high-confidence security patterns from the payment project:
- projectId: proj_payments
- tags: security
- minConfidence: 0.85
- onlyCorroborated: true

Scoping

All exports are tenant-scoped: you can only export your organization's observations. Cedar policies may further restrict exports by:

  • Role - Only operators can export
  • Project - Team lead can only export their project's observations (future work)
  • Classification - Restricted/confidential observations may be filtered (future work)

API Reference

Endpoint: POST /api/memory/export

Request Body:

{
  format: "json-ld" | "csv" | "markdown"
  scope: {
    orgId: string             // required; overridden server-side to authenticated org
    agentId?: string          // filter by agent
    projectId?: string        // filter by project
    dateRange?: {
      from: string            // ISO-8601
      to: string              // ISO-8601
    }
    maxClassification?: "public" | "internal" | "confidential" | "restricted"
    includeRestricted?: boolean  // default false - restricted observations excluded unless true
  }
}

Response: JSON envelope containing a data URL for the export content.

{
  downloadUrl: string         // data:<mime>;base64,<content>
  observationCount: number    // number of observations included
  format: string
}

The downloadUrl is a data: URI. Decode the base64 payload to get the file content. Future versions will return a signed object-storage URL instead.

Example: Export as JSON-LD

curl -X POST "https://api.rensei.ai/api/memory/export" \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "json-ld",
    "scope": {
      "orgId": "org_abc",
      "maxClassification": "internal"
    }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d > memory-export.json

Example: Export as CSV

curl -X POST "https://api.rensei.ai/api/memory/export" \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "csv",
    "scope": { "orgId": "org_abc", "projectId": "proj_xyz" }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d > export.csv

Compliance and Retention

Data Classification (Future)

Observations are classified into tiers (restricted, confidential, internal, public) based on content analysis. Export filters will respect classification policies:

  • Restricted - Not exportable; redacted
  • Confidential - Operator-only export; requires explicit opt-in
  • Internal - Exportable within org
  • Public - Freely exportable, shareable

Soft-Delete and Archival (Partial)

Observations marked outdated or misleading are retained for audit purposes but:

  • Excluded by default from exports (unless includeArchived: true)
  • Flagged in output so you know they were excluded
  • Searchable via /api/audit/events for compliance review

Common Export Workflows

1. Backup High-Value Knowledge

# Export all internal-or-below observations as JSON-LD
curl -X POST https://api.rensei.ai/api/memory/export \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "json-ld",
    "scope": { "orgId": "org_abc", "maxClassification": "internal" }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d \
  > backup-knowledge-$(date +%Y%m%d).json

Cron this weekly for automated backups.

2. Create Engineering Runbook

# Export a single project's observations as Markdown
curl -X POST https://api.rensei.ai/api/memory/export \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "markdown",
    "scope": { "orgId": "org_abc", "projectId": "proj_platform" }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d \
  > RUNBOOK.md

Check into your repo; update quarterly.

3. Compliance Report (BFSI)

# Full export including restricted observations (opt-in)
curl -X POST https://api.rensei.ai/api/memory/export \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "json-ld",
    "scope": { "orgId": "org_abc", "includeRestricted": true }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d \
  > compliance-export-2026-Q2.json

Digest with external compliance tools; sign with your CSO.

4. Date-Windowed Export

# Export observations from Q1 2026 only
curl -X POST https://api.rensei.ai/api/memory/export \
  -H "Authorization: Bearer rsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "format": "csv",
    "scope": {
      "orgId": "org_abc",
      "dateRange": { "from": "2026-01-01T00:00:00Z", "to": "2026-03-31T23:59:59Z" }
    }
  }' | jq -r '.downloadUrl' | sed 's/^data:[^,]*,//' | base64 -d \
  > q1-2026-export.csv

Output Samples

JSON-LD Sample

{
  "@context": "https://rensei.ai/contexts/memory-v1",
  "@type": "MemoryExport",
  "exportedAt": "2026-05-15T10:30:00Z",
  "organization": "org_abc",
  "filtersSummary": {
    "minWeight": 0.75,
    "onlyCorroborated": true
  },
  "observationCount": 42,
  "observations": [
    {
      "@id": "obs_abc123",
      "@type": "Observation",
      "content": "Always validate user input before database operations",
      "type": "security",
      "confidence": 0.98,
      "weight": 0.96,
      "sourceAgent": "agent-qa",
      "createdAt": "2026-05-05T09:20:00Z",
      "updatedAt": "2026-05-12T14:15:00Z",
      "corroborationCount": 4,
      "metadata": {
        "domain": "security",
        "tags": ["sql-injection", "input-validation"],
        "filePathHint": "/src/lib/database/",
        "classification": "internal"
      }
    }
  ]
}

CSV Sample

id,agent,project,timestamp,classification,content_hash,feedback_weight,content
obs_abc123,agent-qa,proj_payments,2026-05-05T09:20:00Z,internal,a3f4e2b1...,0.96,"Always validate user input before database operations"
obs_def456,agent-dev,proj_frontend,2026-05-08T11:45:00Z,internal,c7d9a3f2...,0.88,"Use async/await for Promise chains"

Markdown Sample

# Memory Export - org_abc

Exported: 2026-05-15T10:30:00Z | Observations: 42

## Security (12 observations)

### Input Validation & SQL Injection (4)
- **Always validate user input before database operations**
  - Confidence: 98% | Weight: 0.96 | Corroborated by 4 agents
  - Created: 2026-05-05 | Domain: security
  - Tags: sql-injection, input-validation

## Coding Patterns (18 observations)
...

Limitations and Future Work

Current Limitations

  • No Cedar policy filtering (full org access required to export)
  • No data classification filtering (all tiers exported together)
  • Soft-deleted observations included by default
  • Markdown export doesn't include corroboration chains

In Progress

  • Project-level permission scoping
  • Automated compliance artifact generation
  • Data classification tiers (restricted/confidential/internal/public)
  • Bulk import API for cross-org knowledge transfer

Best Practices

  1. Regular exports - Weekly backups of high-value observations
  2. Filter by weight - Export only mature knowledge (weight >0.70)
  3. Version control - Store exports in Git (especially Markdown)
  4. Compliance audits - Include full exports (no filters) in quarterly reviews
  5. Cross-team sharing - Use Markdown format for wikis and documentation

Rate Limits

The export API enforces a 10 req/min quota per organization (slower than other analytics endpoints due to compute cost). Exports are limited to 10,000 observations per request; paginate with offset parameter for larger batches.

On this page