Tools for using an obsidian vault as a data store with crewai
Find a file
hermes ae806c713f
All checks were successful
CI / ci (push) Successful in 8m10s
ci: re-run via runner pickup verification
2026-09-26 20:06:45 -07:00
.forgejo/workflows ci: override container to catthehacker/ubuntu:act-22.04 and use python3 -m pip 2026-09-11 20:11:34 -07:00
vault feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
vault_1 feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
vault_2 feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
vault_ops docs: Add inline documentation to all files 2025-08-22 17:39:42 -07:00
.pre-commit-config.yaml chore: add basic pre-commit hooks (trailing-whitespace, eof-fixer, ruff) 2026-06-03 17:27:29 -07:00
GEMINI.md feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
multi_vault_crew.py feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
README.md Update README to better represent project functionality 2026-01-15 18:35:44 -08:00
requirements.txt adding initial files 2025-08-21 19:34:27 -07:00
sample_crew.py feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00
USAGE.md feat: Add multi-vault support, backlinks, and index creation 2025-08-22 17:37:34 -07:00

Vault-Ops CrewAI Tool

A comprehensive toolkit for integrating Obsidian vaults with CrewAI agents, providing advanced RAG (Retrieval-Augmented Generation) capabilities along with full CRUD operations and vault maintenance features.

Features

  • RAG Q&A: Query your Obsidian vault using semantic search and retrieval-augmented generation
  • CRUD Operations: Create, read, update, and delete vault files programmatically
  • Vault Maintenance: Automated maintenance tasks including cleaning empty notes, fixing dangling links, managing orphaned attachments, and generating backlinks
  • Multi-Vault Support: Work with multiple vaults simultaneously using separate agents
  • Vector Indexing: FAISS-powered vector indexing for efficient similarity search
  • Secure File Access: Path validation to ensure all operations stay within the vault directory

Installation

  1. Clone the repository:
git clone ssh://git@forgejo.tail018ac4.ts.net/Mark/crewai_vault_ops_tool.git
cd vault_ops_project
  1. Install the required dependencies:
pip install -r requirements.txt

Configuration

The tool can be configured with a custom vault path:

from vault_ops.vault_ops_tool import VaultOpsTool

# Use default vault path (./vault)
vault_tool = VaultOpsTool()

# Or specify a custom vault path
vault_tool = VaultOpsTool(vault_path="./my_custom_vault")

Usage

Basic Usage Example

The sample_crew.py file demonstrates basic usage:

from crewai import Agent, Task, Crew
from vault_ops.vault_ops_tool import VaultOpsTool

# Instantiate the tool
vault_tool = VaultOpsTool()

# Define the agent
researcher = Agent(
  role='Obsidian Vault Researcher',
  goal='Use the vault to answer questions',
  backstory='You are an expert in navigating and understanding the content of an Obsidian vault.',
  tools=[vault_tool],
  verbose=True,
  allow_delegation=False
)

# Define the task
task = Task(
  description='What is CrewAI?',
  agent=researcher
)

# Create and run the crew
crew = Crew(
  agents=[researcher],
  tasks=[task],
  verbose=2
)

result = crew.kickoff()

print("\n\n########################")
print("## Here is the result")
print("########################\n")
print(result)

Multi-Vault Usage

The multi_vault_crew.py file demonstrates how to work with multiple vaults:

from crewai import Agent, Task, Crew
from vault_ops.vault_ops_tool import VaultOpsTool

# Create two instances of the VaultOpsTool, each with a different vault
vault_1_tool = VaultOpsTool(vault_path="./vault_1")
vault_2_tool = VaultOpsTool(vault_path="./vault_2")

# Define two agents, each with a different vault tool
vault_1_researcher = Agent(
  role='Vault 1 Researcher',
  goal='Use vault 1 to answer questions',
  backstory='You are an expert in navigating and understanding the content of vault 1.',
  tools=[vault_1_tool],
  verbose=True,
  allow_delegation=False
)

vault_2_researcher = Agent(
  role='Vault 2 Researcher',
  goal='Use vault 2 to answer questions',
  backstory='You are an expert in navigating and understanding the content of vault 2.',
  tools=[vault_2_tool],
  verbose=True,
  allow_delegation=False
)

# Define two tasks, one for each agent
task_1 = Task(
  description='What is in this vault?',
  agent=vault_1_researcher
)

task_2 = Task(
  description='What is in this vault?',
  agent=vault_2_researcher
)

# Create and run the crew
crew = Crew(
  agents=[vault_1_researcher, vault_2_researcher],
  tasks=[task_1, task_2],
  verbose=2
)

result = crew.kickoff()

print("\n\n########################")
print("## Here is the result")
print("########################\n")
print(result)

Available Actions

The VaultOpsTool supports the following actions:

  • ask: Perform semantic search and Q&A on the vault content
  • create: Create new files in the vault
  • read: Read content from existing files
  • update: Update content in existing files
  • delete: Delete files from the vault
  • maintenance: Run various maintenance tasks on the vault

Maintenance Tasks

The tool provides several maintenance capabilities:

  • empty: Remove empty notes
  • dangling: Find dangling links
  • orphans: Remove orphaned attachments
  • backlinks: Generate backlinks section in notes
  • index: Create an index file linking all notes

Dependencies

  • crewai
  • sentence-transformers
  • faiss-cpu
  • watchfiles
  • pyyaml
  • mistune

Project Structure

vault_ops_project/
├── multi_vault_crew.py      # Example of multi-vault usage
├── sample_crew.py          # Basic usage example
├── requirements.txt        # Project dependencies
├── README.md              # This file
├── vault/                 # Default vault directory
├── vault_1/, vault_2/     # Example vault directories
└── vault_ops/             # Main module
    ├── vault_ops_tool.py  # Core VaultOpsTool implementation
    ├── embedder.py        # Vector embedding utilities
    └── maintenance.py     # Vault maintenance utilities

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.