Skip to main content
Read the L0 abstract (~100 token summary) of a directory or file. This is the most concise layer in OpenViking’s hierarchical context system.

Python SDK

from openviking import OpenViking

client = OpenViking()

# Get abstract of a directory
abstract = client.abstract("viking://resources/docs/")
print(f"Abstract: {abstract}")
# Output: "Documentation for the project API, covering authentication, endpoints..."

HTTP API

curl -X GET "http://localhost:1933/api/v1/content/abstract?uri=viking://resources/docs/" \
  -H "X-API-Key: your-key"
GET /api/v1/content/abstract?uri=viking://resources/docs/

Parameters

uri
string
required
Viking URI (typically a directory, but can also be a file)

Response

status
string
Operation status (ok on success)
result
string
The L0 abstract summary (~100 tokens)
time
number
Execution time in seconds
{
  "status": "ok",
  "result": "Documentation for the project API, covering authentication, endpoints, error handling, and best practices.",
  "time": 0.1
}

CLI

openviking abstract viking://resources/docs/

Context Layers

OpenViking provides three hierarchical levels of content:
  • L0 (Abstract): ~100 token summary via abstract() (this method)
  • L1 (Overview): Structured overview via overview()
  • L2 (Full): Complete content via read()
The abstract layer is ideal for:
  • Quick directory summaries
  • Agent context where token efficiency is critical
  • Initial exploration of large codebases

Implementation Details

The abstract is stored in a .abstract.md file within the directory. If not present, it’s generated automatically from the directory contents.