Skip to main content
The Workspace class is the SDK surface for VectorShift Workspaces — secure data rooms for your documents. Group related workspaces under a Portal, load documents into a workspace, open a chat session to ask questions about them, and run Verification checks that flag unsupported claims, stale figures, and inconsistencies across documents.
Prerequisites: Installed SDK · API key set · Python 3.10+.

Mental model

  • A Portal is your team’s top-level space. It groups related workspaces and holds the agents and skills available to them.
  • A Workspace is a secure data room that lives inside a portal. It holds a set of documents you can search, chat with, and verify.
  • Documents are the files in a workspace. Add them with workspace.upload(...) or manage them through workspace.documents.
  • A chat session (workspace.create_session()) lets you ask questions in plain language and get answers grounded in the workspace’s documents.
  • A Verification checks one document against everything else in the workspace and returns a list of issues to review — unsupported numbers, stale figures, mismatches between documents, and more.
  • Every method has an async variant prefixed with a (anew, aupload, acreate_session, …).

Quick start

from vectorshift import Workspace
from vectorshift.workspace import Portal

# A portal groups related workspaces together.
portal = Portal.new(name="Acme Research")

# Create a workspace (a data room) under the portal — safe to re-run.
ws = Workspace.get_or_create(name="Q3 Report Review", portal=portal)

# Load documents, then ask questions about them.
ws.upload("./report.pdf", "./documents/")
session = ws.create_session()
print(session.send("What are the key risks called out in the report?"))

Working with documents

Add files (or whole folders) to a workspace’s data room with upload:
files = ws.upload("./report.pdf", "./documents/")
For finer control, use the documents manager to list what’s in the data room or remove a file from it:
for doc in ws.documents.list():
    print(doc.name)

ws.documents.remove(files[0])   # removes it from this workspace

Chatting with a workspace

create_session() opens a chat grounded in the workspace’s documents. Sessions keep context across turns, so you can ask follow-up questions:
session = ws.create_session()
print(session.send("Summarize the key findings."))
print(session.send("How do they compare to last quarter?"))

Verifying documents

A verification checks a document against the rest of the workspace and reports back issues to review. Create one from the workspace, run it, then triage what it finds:
from vectorshift.workspace import CheckType, IssueSeverity

v = ws.verifications.new(name="Report check", main_file="./report.pdf")
run = v.run_and_wait(enabled_checks=[CheckType.PRIMARY_SOURCE, CheckType.CROSS_DOCUMENT])
print(f"{run['total_issues']} issues found")

# Review the most serious findings.
for issue in v.issues(severity=[IssueSeverity.ERROR]):
    issue.flag(comment="Needs review")
See Verification and Verification issue for the full set of options and triage actions.

Portals, agents, and skills

A portal groups workspaces and exposes the agents and skills your team can use. List the workspaces under a portal, open a portal-level chat, or run one of the portal’s agents:
portal = Portal.fetch(name="Acme Research")

for ws in portal.workspaces.list():
    print(ws.name)

analyst = portal.agent(name="Report Analyst")
analyst.run("Summarize this quarter's report")
See the Portal reference for everything a portal can do.

What’s next

Reference

Every public method on Workspace, grouped by topic.

Portal

Group related workspaces and the agents and skills available to them.

Verification

Check a document against the data room and triage the issues it finds.

Examples

Runnable examples to copy-paste and adapt.