Sentinel is designed to be a versatile component in your AI stack. You can use it in three main ways:
Integrate Sentinel directly into your Python applications (FastAPI, Django, Flask, or scripts).
- Use case: Building a custom RAG pipeline, a research assistant, or a data monitoring bot.
- How: Import
Sentinel,GraphManager, andGraphExtractorto build custom workflows.
Run Sentinel from your terminal to manage knowledge graphs without writing code.
- Use case: Quick scraping, monitoring a specific URL, or checking system status.
- How: Run
sentinel init,sentinel watch <url>,sentinel status.
Use the Neo4j graph created by Sentinel as a rich context source for your LLMs.
- Use case: Chatbots that need historical context or structured data (not just vector similarity).
- How: Connect your RAG chain (LangChain, LlamaIndex) to the Neo4j database populated by Sentinel.
Sentinel requires:
- Neo4j Database: To store the knowledge graph.
- LLM: Ollama (local) or OpenAI/Anthropic (cloud) to extract knowledge.
Best for getting started quickly.
-
Install:
pip install sentinel-core
-
Initialize:
# Sets up your .env file and checks connections python -m sentinel_core.cli init -
Watch a URL:
# Scrapes, extracts, and saves to Neo4j python -m sentinel_core.cli watch https://example.com -
Auto-Heal:
# Checks for stale data and updates it python -m sentinel_core.cli heal
Best for building custom applications.
import asyncio
from sentinel_core import Sentinel, GraphManager, GraphExtractor
from sentinel_core.scraper import get_scraper
async def main():
# 1. Setup components
graph = GraphManager() # Connects to Neo4j
scraper = get_scraper() # Uses Firecrawl or Local
extractor = GraphExtractor(model_name="ollama/phi3") # Uses your LLM
sentinel = Sentinel(graph, scraper, extractor)
# 2. Process a website
print("Processing...")
result = await sentinel.process_url("https://docs.python.org/3/")
print(f"Done! Extracted {result['extracted_nodes']} nodes.")
# 3. Query the graph (Time Travel)
# Get the state of the graph as it was yesterday
# snapshot = graph.get_graph_snapshot(timestamp=yesterday)
if __name__ == "__main__":
asyncio.run(main())Once Sentinel has populated your Neo4j database, you can query it using LangChain.
from langchain_community.graphs import Neo4jGraph
from langchain.chains import GraphCypherQAChain
from langchain_openai import ChatOpenAI
# 1. Connect to the same Neo4j instance Sentinel is using
graph = Neo4jGraph(
url="bolt://localhost:7687",
username="neo4j",
password="password"
)
# 2. Create a QA chain
chain = GraphCypherQAChain.from_llm(
ChatOpenAI(temperature=0),
graph=graph,
verbose=True
)
# 3. Ask questions based on Sentinel's data
response = chain.run("What entities are related to 'Python'?")
print(response)- CLI Reference - All command line options.
- Examples - Real-world scenarios (Pricing monitor, News aggregator).
- Quick Start - Detailed installation steps.