Skip to content

API Reference parrot.stores.arango

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.stores.arango

View source

ArangoDBStore: Vector Store implementation for ArangoDB.

Provides comprehensive vector storage with graph support, including:

  • Database and collection management
  • Graph creation and management
  • Document operations with upsert support
  • Vector similarity search
  • Full-text search (BM25)
  • Hybrid search (vector + text)
  • Graph-enhanced retrieval

Alias AbstractStore

Re-exported from parrot.stores.abstract.AbstractStore.

Class ArangoDBStore

ArangoDB Vector Store with native graph support.

Features:

  • Multi-model database (documents, graphs, key-value)
  • Native graph operations for knowledge graphs
  • ArangoSearch for full-text and vector search
  • Hybrid search combining semantic and keyword
  • Graph-enhanced RAG with relationship context
Parameter Type Default Description
database str '_system' Database name
collection_name str 'documents' Default collection for documents
embedding_column str 'embedding' Field name for embeddings
text_column str 'content' Field name for text content
metadata_column str 'metadata' Field name for metadata
id_column str '_key' Field name for document ID (_key)
embedding_model Union[dict, str] None Embedding model configuration
embedding Optional[Callable] None Custom embedding function
distance_strategy DistanceStrategy DistanceStrategy.COSINE Distance metric (COSINE, L2, DOT_PRODUCT)
host str '127.0.0.1' ArangoDB host
port int 8529 ArangoDB port
protocol str 'http' Connection protocol (http/https)
username str 'root' Database username
password str '' Database password
default_graph Optional[str] None Default graph name
default_view Optional[str] None Default ArangoSearch view name
edge_collection str 'relationships' Default edge collection name
auto_create_view bool True Auto-create ArangoSearch view
view_analyzer str 'text_en' Text analyzer for views
**kwargs {}

Method ArangoDBStore.connection

Establish connection to ArangoDB.

connection() -> tuple

Returns: tuple — Tuple of (connection, None) or (None, error)

Method ArangoDBStore.disconnect

Close ArangoDB connection.

disconnect() -> None

Method ArangoDBStore.get_vector

Get vector store instance.

get_vector(metric_type: str = None, **kwargs)

Parameter Type Default Description
metric_type str None
**kwargs {}

Method ArangoDBStore.create_database

Create a new database.

create_database(database_name: str) -> bool

Parameter Type Default Description
database_name str Name of database to create

Returns: bool — True if successful

Method ArangoDBStore.drop_database

Drop a database.

drop_database(database_name: str) -> bool

Parameter Type Default Description
database_name str Name of database to drop

Returns: bool — True if successful

Method ArangoDBStore.use_database

Switch to a different database.

use_database(database_name: str) -> None

Parameter Type Default Description
database_name str Database to switch to

Method ArangoDBStore.create_collection

Create a collection (document or edge).

create_collection(collection: str, edge: bool = False, **kwargs) -> bool

Parameter Type Default Description
collection str Collection name
edge bool False If True, create edge collection
**kwargs {} Additional collection properties

Returns: bool — True if created or already exists

Method ArangoDBStore.delete_collection

Drop a collection.

delete_collection(collection: str) -> bool

Parameter Type Default Description
collection str Collection name to drop

Returns: bool — True if successful

Method ArangoDBStore.collection_exists

Check if collection exists.

collection_exists(collection: str) -> bool

Parameter Type Default Description
collection str Collection name

Returns: bool — True if exists

Method ArangoDBStore.create_graph

Create a named graph.

create_graph(graph_name: str, vertex_collections: List[str], edge_collection: str = None, orphan_collections: List[str] = None) -> bool

Parameter Type Default Description
graph_name str Name of the graph
vertex_collections List[str] List of vertex collection names
edge_collection str None Edge collection name (defaults to self.edge_collection)
orphan_collections List[str] None Vertex collections without edges

Returns: bool — True if successful

Method ArangoDBStore.drop_graph

Drop a graph.

drop_graph(graph_name: str, drop_collections: bool = False) -> bool

Parameter Type Default Description
graph_name str Graph name
drop_collections bool False If True, also drop associated collections

Returns: bool — True if successful

Method ArangoDBStore.graph_exists

Check if graph exists.

graph_exists(graph_name: str) -> bool

Parameter Type Default Description
graph_name str

Returns: bool

Method ArangoDBStore.create_view

Create an ArangoSearch view.

create_view(view_name: str, collections: List[str], text_fields: List[str] = None, vector_field: str = None, analyzer: str = None, **kwargs) -> bool

Parameter Type Default Description
view_name str Name for the view
collections List[str] Collections to include
text_fields List[str] None Text fields to index
vector_field str None Vector field to index
analyzer str None Text analyzer (defaults to view_analyzer)
**kwargs {} Additional view properties

Returns: bool — True if successful

Method ArangoDBStore.drop_view

Drop an ArangoSearch view.

drop_view(view_name: str) -> bool

Parameter Type Default Description
view_name str

Returns: bool

Method ArangoDBStore.add_document

Add a single document with upsert support.

add_document(document: Union[Document, dict], collection: str = None, upsert: bool = True, upsert_key: Optional[str] = None, upsert_metadata_keys: Optional[List[str]] = None, **kwargs) -> Dict[str, Any]

Parameter Type Default Description
document Union[Document, dict] Document to add (Document object or dict)
collection str None Collection name (defaults to self.collection_name)
upsert bool True If True, update existing document if key exists
upsert_key Optional[str] None Specific key field to use for upsert matching
upsert_metadata_keys Optional[List[str]] None Metadata fields to match for upsert
**kwargs {} Additional arguments

Returns: Dict[str, Any] — Inserted/updated document metadata

Method ArangoDBStore.add_documents

Add multiple documents.

add_documents(documents: List[Union[Document, dict]], collection: str = None, upsert: bool = True, batch_size: int = 100, **kwargs) -> int

Parameter Type Default Description
documents List[Union[Document, dict]] List of documents to add
collection str None Collection name
upsert bool True If True, update existing documents
batch_size int 100 Batch size for bulk operations
**kwargs {} Additional arguments

Returns: int — Number of documents processed

Method ArangoDBStore.save_documents

Save documents with upsert (alias for add_documents with upsert=True).

save_documents(documents: List[Union[Document, dict]], collection: str = None, **kwargs) -> int

Parameter Type Default Description
documents List[Union[Document, dict]] Documents to save
collection str None Collection name
**kwargs {} Additional arguments

Returns: int — Number of documents saved

Method ArangoDBStore.delete_documents_by_filter

Delete documents matching filter conditions.

delete_documents_by_filter(filter_dict: Dict[str, Any], collection: str = None, **kwargs) -> int

Parameter Type Default Description
filter_dict Dict[str, Any] Filter conditions (e.g., {'category': 'test'})
collection str None Collection name
**kwargs {} Additional arguments

Returns: int — Number of documents deleted

Method ArangoDBStore.similarity_search

Perform vector similarity search.

similarity_search(query: str, collection: str = None, limit: int = 10, similarity_threshold: float = 0.0, search_strategy: str = 'auto', metadata_filters: Union[dict, None] = None, include_graph_context: bool = False, **kwargs) -> List[SearchResult]

Parameter Type Default Description
query str Query text
collection str None Collection to search
limit int 10 Maximum results
similarity_threshold float 0.0 Minimum similarity score
search_strategy str 'auto' Search strategy (auto, vector, hybrid)
metadata_filters Union[dict, None] None Metadata filter conditions
include_graph_context bool False Include graph neighbors
**kwargs {} Additional arguments

Returns: List[SearchResult] — List of SearchResult objects

Method ArangoDBStore.fulltext_search

Perform full-text search using BM25.

fulltext_search(query: str, collection: str = None, text_fields: List[str] = None, limit: int = 10, min_score: float = 0.0, analyzer: str = None, metadata_filters: dict = None, **kwargs) -> List[SearchResult]

Parameter Type Default Description
query str Search query text
collection str None Collection to search
text_fields List[str] None Fields to search
limit int 10 Maximum results
min_score float 0.0 Minimum BM25 score
analyzer str None Text analyzer
metadata_filters dict None Metadata filters
**kwargs {} Additional arguments

Returns: List[SearchResult] — List of SearchResult objects

Method ArangoDBStore.hybrid_search

Perform hybrid search combining vector and text.

hybrid_search(query: str, collection: str = None, limit: int = 10, text_weight: float = 0.5, vector_weight: float = 0.5, text_fields: List[str] = None, analyzer: str = None, metadata_filters: dict = None, **kwargs) -> List[SearchResult]

Parameter Type Default Description
query str Search query
collection str None Collection to search
limit int 10 Maximum results
text_weight float 0.5 Weight for text score (0-1)
vector_weight float 0.5 Weight for vector score (0-1)
text_fields List[str] None Text fields to search
analyzer str None Text analyzer
metadata_filters dict None Metadata filters
**kwargs {} Additional arguments

Returns: List[SearchResult] — List of SearchResult objects

Method ArangoDBStore.document_search

Unified document search interface.

document_search(query: str, search_type: str = 'similarity', collection: str = None, limit: int = 10, **kwargs) -> List[SearchResult]

Parameter Type Default Description
query str Search query
search_type str 'similarity' Type of search (similarity, fulltext, hybrid)
collection str None Collection to search
limit int 10 Maximum results
**kwargs {} Additional search parameters

Returns: List[SearchResult] — List of SearchResult objects

Method ArangoDBStore.from_documents

Create vector store from documents.

from_documents(documents: List[Any], collection: Union[str, None] = None, **kwargs) -> 'ArangoDBStore'

Parameter Type Default Description
documents List[Any] List of Document objects
collection Union[str, None] None Collection name
**kwargs {} Additional arguments

Returns: 'ArangoDBStore' — Self

Method ArangoDBStore.prepare_embedding_table

Prepare collection for vector storage.

prepare_embedding_table(collection: str = None, recreate: bool = False, **kwargs) -> bool

Parameter Type Default Description
collection str None Collection name
recreate bool False If True, drop and recreate collection
**kwargs {} Additional arguments

Returns: bool — True if successful

Attribute ArangoStore

Alias DistanceStrategy

Re-exported from parrot.stores.models.DistanceStrategy.

Alias Document

Re-exported from parrot.stores.models.Document.

Alias EMBEDDING_DEFAULT_MODEL

Re-exported from parrot.conf.EMBEDDING_DEFAULT_MODEL.

Alias SearchResult

Re-exported from parrot.stores.models.SearchResult.

Alias lazy_import

Re-exported from parrot._imports.lazy_import.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally