from raglight.agentic import AgenticPipeline, FunctionTool
from raglight.integrations.chroma import ChromaVectorStore
from raglight.integrations.ollama import OllamaEmbeddings, OllamaLLM
from raglight.models import Document
embeddings = OllamaEmbeddings(model_name="nomic-embed-text")
llm = OllamaLLM(model_name="qwen3:8b", preload_model=False)
vector_store = ChromaVectorStore(
collection_name="agentic-docs",
embeddings_model=embeddings,
persist_directory="./agentic-db",
)
vector_store.add_documents(
[
Document(
page_content="Production support is available from 08:00 to 18:00 UTC.",
metadata={"source": "support.md"},
)
]
)
status_tool = FunctionTool(
name="service_status",
description="Return the current status of a named service.",
input_schema={
"type": "object",
"properties": {"service": {"type": "string"}},
"required": ["service"],
},
handler=lambda arguments: f"{arguments['service']} is operational",
)
pipeline = AgenticPipeline(
llm=llm,
embeddings=embeddings,
vector_store=vector_store,
tools=[status_tool],
max_steps=5,
top_k=4,
)
response = pipeline.generate(
"Is the billing service operational, and when can I contact support?"
)
print(response.answer)
print([event.to_dict() for event in response.events])