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:
- Creates a new version with the updated content
- Re-processes and re-embeds the document
- Keeps all previous versions accessible
- 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
| Plan | Retention |
|---|---|
| Starter | 30 days |
| Pro | 90 days |
| Team | 1 year |
| Enterprise | Unlimited |
After retention period, old versions are archived. You can request restoration from support.
Best Practices
- Meaningful updates - Don't create versions for trivial changes
- Add metadata - Include
change_reasonin update metadata - Regular audits - Review version history for compliance
- 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