Skip to main content

Versioning

Inherent automatically versions every document, giving you complete history and the ability to see exactly what your AI knew at any point in time.

How It Works

When you update a document, Inherent:

  1. Creates a new version with the updated content
  2. Re-processes and re-embeds the document
  3. Keeps all previous versions accessible
  4. Updates search to use the latest version (by default)

Viewing Version History

List all versions of a document:

curl https://api.inherent.systems/v1/documents/doc_abc123/versions \
-H "Authorization: Bearer $INHERENT_API_KEY"

Response:

{
"versions": [
{
"version": 3,
"created_at": "2024-01-15T14:30:00Z",
"created_by": "api_key_xyz",
"size_bytes": 2048,
"chunk_count": 5
},
{
"version": 2,
"created_at": "2024-01-10T09:00:00Z",
"created_by": "api_key_xyz",
"size_bytes": 1892,
"chunk_count": 4
},
{
"version": 1,
"created_at": "2024-01-05T11:00:00Z",
"created_by": "api_key_xyz",
"size_bytes": 1024,
"chunk_count": 3
}
]
}

Getting a Specific Version

Retrieve a specific version:

curl https://api.inherent.systems/v1/documents/doc_abc123/versions/2 \
-H "Authorization: Bearer $INHERENT_API_KEY"

Comparing Versions

Compare two versions to see what changed:

curl "https://api.inherent.systems/v1/documents/doc_abc123/versions/compare?from=1&to=3" \
-H "Authorization: Bearer $INHERENT_API_KEY"

Response:

{
"from_version": 1,
"to_version": 3,
"changes": {
"added_chunks": 2,
"removed_chunks": 0,
"modified_chunks": 1,
"diff": [
{
"type": "added",
"content": "New section about authentication..."
},
{
"type": "modified",
"old_content": "Old introduction...",
"new_content": "Updated introduction..."
}
]
}
}

Rolling Back

Restore a previous version:

curl -X POST https://api.inherent.systems/v1/documents/doc_abc123/rollback \
-H "Authorization: Bearer $INHERENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target_version": 2
}'

This creates a new version (v4) with the content from v2. The history is preserved.

Searching at a Point in Time

Query your knowledge base as it existed at a specific time:

curl -X POST https://api.inherent.systems/v1/search \
-H "Authorization: Bearer $INHERENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "authentication flow",
"as_of": "2024-01-10T00:00:00Z"
}'

This is critical for:

  • Auditing - What did the AI know when it made a decision?
  • Debugging - Reproduce issues with historical context
  • Compliance - Demonstrate what information was available

Version Retention

PlanRetention
Starter30 days
Pro90 days
Team1 year
EnterpriseUnlimited

After retention period, old versions are archived. You can request restoration from support.

Best Practices

  1. Meaningful updates - Don't create versions for trivial changes
  2. Add metadata - Include change_reason in update metadata
  3. Regular audits - Review version history for compliance
  4. Use point-in-time - Debug AI responses with historical context

Audit Logs

All version operations are logged:

curl https://api.inherent.systems/v1/audit-logs?document_id=doc_abc123 \
-H "Authorization: Bearer $INHERENT_API_KEY"

Log entries include:

  • Action type (create, update, rollback)
  • User/API key
  • Timestamp
  • Before/after metadata

Next Steps