Python SDK for Veculo — AI-native multi-modal graph+vector database
Project description
Veculo Python SDK
Python client for Veculo — a managed graph+vector database built on Apache Accumulo.
Installation
pip install veculo
Quick Start
With auto-generated embeddings (easiest)
from veculo import VeculoClient
client = VeculoClient(api_key="vk-...", cluster_id="cl-a7f3b2")
# Insert vertices — Veculo generates embeddings from text automatically
client.put_vertex_with_text(
id="doc-1",
text="Q1 revenue exceeded expectations with 40% YoY growth driven by enterprise expansion",
label="document",
properties={"author": "Alice", "quarter": "Q1"},
embed_server_side=True,
)
client.put_vertex_with_text(
id="doc-2",
text="Project Plan for Q2 focuses on APAC market entry and partner channel development",
label="document",
properties={"author": "Bob", "quarter": "Q2"},
embed_server_side=True,
)
# Create edges
client.put_edge(source="doc-1", target="doc-2", edge_type="references")
# Ask questions in natural language — answers grounded in your graph
answer = client.rag_query(
question="What drove Q1 growth and what's planned for Q2?",
context_hops=2,
)
print(answer["answer"]) # LLM-synthesized answer with citations
print(answer["sources"]) # ["doc-1", "doc-2"]
With your own embeddings
from veculo import VeculoClient
client = VeculoClient(api_key="vk-...", cluster_id="cl-a7f3b2")
# Insert vertices with pre-computed embedding vectors
client.put_vertex(
id="doc-1",
label="document",
properties={"title": "Quarterly Report", "author": "Alice"},
embedding=[0.12, 0.45, 0.78, 0.33, 0.21, 0.56, 0.89, 0.12],
visibility="INTERNAL",
)
client.put_vertex(
id="doc-2",
label="document",
properties={"title": "Project Plan", "author": "Bob"},
embedding=[0.11, 0.44, 0.80, 0.31, 0.19, 0.58, 0.87, 0.14],
)
# Create edges
client.put_edge(
source="doc-1",
target="doc-2",
edge_type="references",
properties={"section": "appendix"},
)
# Hybrid query: vector similarity + graph traversal
results = client.query(
embedding=[0.12, 0.44, 0.79, 0.32, 0.15, 0.67, 0.23, 0.91],
top_k=5,
edge_type="references",
depth=2,
authorizations="INTERNAL",
)
for match in results["results"]:
print(f"{match['vertex_id']}: {match['score']:.3f}")
Environment Variables
Instead of passing credentials to the constructor, you can set:
| Variable | Description |
|---|---|
VECULO_API_KEY |
API key for authentication |
VECULO_ENDPOINT |
API endpoint (default: https://api.veculo.com) |
VECULO_CLUSTER_ID |
Target cluster ID |
# With env vars set, no arguments needed:
client = VeculoClient()
CLI
The SDK includes a command-line interface:
# Save connection configuration
veculo connect --endpoint https://api.veculo.com --api-key vk-... --cluster-id cl-a7f3b2
# Check cluster status
veculo status
# Insert a vertex
veculo put-vertex --id alice --label person --property name=Alice --property role=engineer
# Retrieve a vertex
veculo get-vertex --id alice
# Create an edge
veculo put-edge --source alice --target bob --type knows
# Run a hybrid query
veculo query --embedding "0.1,0.2,0.3,0.4" --top-k 10
Configuration is stored in ~/.veculo/config.json.
Error Handling
from veculo import VeculoClient, VeculoError, NotFoundError, AuthenticationError
client = VeculoClient(api_key="vk-...", cluster_id="cl-a7f3b2")
try:
vertex = client.get_vertex(id="nonexistent")
except NotFoundError:
print("Vertex does not exist")
except AuthenticationError:
print("Invalid or expired API key")
except VeculoError as e:
print(f"API error {e.status_code}: {e.message}")
Visibility Labels
Veculo supports Accumulo-style cell-level security via visibility expressions:
# Write with visibility
client.put_vertex(
id="doc:internal-report",
label="document",
properties={"title": "Q1 Revenue Analysis"},
visibility="finance&internal",
)
# Read with authorizations
vertex = client.get_vertex(
id="doc:internal-report",
authorizations="finance,internal",
)
Embeddings
Veculo supports multiple ways to generate vector embeddings:
Client-side (bring your own API key)
from veculo import VeculoClient
from veculo.embeddings import OpenAIEmbeddings
client = VeculoClient(api_key="vk-...", cluster_name="production")
client.set_embedder(OpenAIEmbeddings(api_key="sk-..."))
# Automatically generates embedding from text
client.put_vertex_with_text(
id="doc:report-q1",
text="Q1 revenue exceeded expectations with 40% YoY growth",
label="document",
properties={"quarter": "Q1", "year": "2026"},
)
Other providers:
from veculo.embeddings import VertexAIEmbeddings, SentenceTransformerEmbeddings
# Vertex AI
client.set_embedder(VertexAIEmbeddings(project="my-project"))
# Local (no API key needed)
client.set_embedder(SentenceTransformerEmbeddings())
Install extras: pip install 'veculo[openai]', pip install 'veculo[vertexai]', or pip install 'veculo[local]'
Server-side (Veculo-managed, billed separately)
# Veculo generates the embedding for you server-side
client.put_vertex_with_text(
id="doc:report-q1",
text="Q1 revenue exceeded expectations",
label="document",
embed_server_side=True, # billed per request
)
Multi-Modal Knowledge Graphs
Upload any file — Veculo automatically extracts text, generates embeddings, discovers entities, and builds a knowledge subgraph.
Supported file types
| Type | What Veculo extracts |
|---|---|
| Text, citations, entities, embeddings | |
| Images | Visual description, objects, entities, embeddings |
| Audio | Transcript, entities, embeddings |
| Video | Audio transcript, entities, embeddings |
| Code | Functions, classes, imports, embeddings |
Upload a file
# Upload a PDF — Veculo does the rest
client.put_vertex_with_file(
id="paper:arxiv-2401",
file_path="attention-is-all-you-need.pdf",
label="paper",
properties={"source": "arxiv"},
)
# Upload an image
client.put_vertex_with_file(
id="img:brain-scan-001",
file_path="brain-scan.png",
label="medical-image",
)
# Upload source code
client.put_vertex_with_file(
id="code:transformer",
file_path="transformer.py",
label="code",
)
Check extraction status
jobs = client.list_jobs()
for job in jobs["jobs"]:
print(f"{job['vertex_id']}: {job['status']}")
CLI
veculo upload --id paper-1 --file paper.pdf --label paper
veculo jobs
veculo get-vertex --id paper-1
AI-Native Queries
Natural Language Query
Ask questions in plain English — the SDK translates them into graph queries via LLM:
result = client.nl_query(
question="Which documents reference the Q1 report?",
authorizations="internal",
)
print(result["query_plan"]["explanation"])
for step_result in result["results"]:
print(step_result)
Graph-Augmented RAG
Retrieval-Augmented Generation that combines vector search with graph context:
answer = client.rag_query(
question="What were the key findings in the Q1 analysis?",
context_hops=2, # expand graph 2 hops for richer context
model="claude-sonnet-4-20250514", # optional model override
top_k=10,
)
print(answer["answer"])
print("Sources:", answer["sources"]) # vertex IDs cited
Bulk Operations
Insert many vertices or edges in a single batch:
client.put_vertices_bulk([
{"id": "doc:1", "label": "document", "properties": {"title": "Report A"}},
{"id": "doc:2", "label": "document", "properties": {"title": "Report B"}},
{"id": "doc:3", "label": "document", "properties": {"title": "Report C"}},
])
client.put_edges_bulk([
{"source": "doc:1", "target": "doc:2", "edge_type": "references"},
{"source": "doc:2", "target": "doc:3", "edge_type": "references"},
])
Hibernate / Resume
Stop compute costs while preserving all data in storage:
# Hibernate — flushes tables, snapshots metadata, tears down compute
client.hibernate()
# Storage continues at ~$0.02/GB/month, compute costs stop immediately
# Later — resume with all data intact
client.resume()
Data, metadata, embeddings, and edges are all preserved. Only compute is stopped.
Configuration
Auto-Embed
Enable automatic embedding generation for new text vertices:
client.configure_auto_embed(
model="text-embedding-005",
text_properties=["description", "content"],
)
Semantic Edges
Enable automatic similarity edge creation during compaction:
client.configure_semantic_edges(
similarity_threshold=0.85,
max_edges_per_vertex=10,
)
Insights
Query AI-derived analytics:
# Anomalous vertices (outliers by embedding distance)
anomalies = client.get_anomalies(authorizations="internal")
# Top vertices by PageRank
ranks = client.get_top_ranked()
# Pending processing queue status
status = client.get_processing_status()
print(f"Embeddings pending: {status['auto_embed']}")
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veculo-0.2.6.tar.gz.
File metadata
- Download URL: veculo-0.2.6.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79058b355ec65f2c4623e78f9dfa63105d56319dfdc70aad91b213bf2a7ed8c6
|
|
| MD5 |
f25e29292f36a94e0f6ef7e11301c814
|
|
| BLAKE2b-256 |
62b1ff0e158a659c241efced7f2e7f5468cb76066c14adbb387a837c6cb7b78d
|
File details
Details for the file veculo-0.2.6-py3-none-any.whl.
File metadata
- Download URL: veculo-0.2.6-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4d558ac7907b5a794ff3773bd73663712366d9b5dc549a9abe711eb41633837
|
|
| MD5 |
a8aec6da3ebcbdf1462e270bc7cc5a86
|
|
| BLAKE2b-256 |
ae9c659627eec74670234ea23ecc0a4eb0f9e0a588d5630cec10f880de1049c1
|