Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pip install vectorless

```python
import asyncio
from vectorless import Engine, IndexContext
from vectorless import Engine, IndexContext, QueryContext

async def main():
# Create engine — api_key and model are required
Expand All @@ -38,11 +38,13 @@ async def main():
)

# Index a document (PDF or Markdown)
result = await engine.index(IndexContext.from_file("./report.pdf"))
result = await engine.index(IndexContext.from_path("./report.pdf"))
doc_id = result.doc_id

# Query
result = await engine.query(doc_id, "What is the total revenue?")
result = await engine.query(
QueryContext("What is the total revenue?").with_doc_ids([doc_id])
)
print(result.single().content)

asyncio.run(main())
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2026-04-12-welcome/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def main():
)

# Index a document
result = await engine.index(IndexContext.from_file("./report.pdf"))
result = await engine.index(IndexContext.from_path("./report.pdf"))
doc_id = result.doc_id

# Query
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def main():
model="gpt-4o",
)

result = await engine.index(IndexContext.from_file("./report.pdf"))
result = await engine.index(IndexContext.from_path("./report.pdf"))
doc_id = result.doc_id

answer = await engine.query(doc_id, "What is the total revenue?")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def main():

# Index a document
result = await engine.index(
IndexContext.from_file("./report.pdf")
IndexContext.from_path("./report.pdf")
)
doc_id = result.doc_id

Expand Down