• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joagonzalez / cyclops-devops-agent / 15571014953

10 Jun 2025 09:48PM UTC coverage: 75.613% (-10.8%) from 86.441%
15571014953

push

github

web-flow
Merge pull request #49 from joagonzalez/rc-v0.1.0

Rc v0.1.0

110 of 230 new or added lines in 11 files covered. (47.83%)

617 of 816 relevant lines covered (75.61%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.19
/src/cyclops_graph.py
1
from langgraph.graph import StateGraph, END, START
1✔
2
from src.services.prometheus import PrometheusClient
1✔
3
from src.services.vectordb import MetricVectorStore
1✔
4
from src.services.chatgpt import ChatGPTService
1✔
5
from src.config.settings import config
1✔
6

7
from src.tools.promql_executor_tool import PromQLExecutorTool
1✔
8
from src.tools.vector_search_tool import VectorSearchTool
1✔
9
from src.tools.llm_decompose_tool import LLMDecomposeTool
1✔
10
from src.tools.llm_generate_promql_tool import LLMGeneratePromQLTool
1✔
11
from src.tools.llm_summarize_tool import LLMSummarizeTool
1✔
12

13

14
# Setup shared clients
15
prom_client = PrometheusClient(base_url=config["PROMETHEUS_URL"])
1✔
16
vector_store = MetricVectorStore(persist_directory="./chroma_db")
1✔
17
llm_client = ChatGPTService(api_key=config["OPENAI"]["API_KEY"], model=config["OPENAI"]["MODEL"])
1✔
18

19
# Instantiate tools
20
promql_tool = PromQLExecutorTool(prometheus_client=prom_client)
1✔
21
vector_tool = VectorSearchTool(vector_store=vector_store, default_top_k=5)
1✔
22
llm_decompose_tool = LLMDecomposeTool(llm_client)
1✔
23
llm_generate_promql_tool = LLMGeneratePromQLTool(llm_client)
1✔
24
llm_summarize_tool = LLMSummarizeTool(llm_client)
1✔
25

26
# Define LangGraph
27
graph = StateGraph(dict)  # we use simple dict state for now
1✔
28

29
# Add nodes
30
graph.add_node("Decompose", llm_decompose_tool)
1✔
31
graph.add_node("VectorSearch", vector_tool)
1✔
32
graph.add_node("GeneratePromQL", llm_generate_promql_tool)
1✔
33
graph.add_node("ExecutePromQL", promql_tool)
1✔
34
graph.add_node("Summarize", llm_summarize_tool)
1✔
35

36
# Add edges (pipeline)
37
graph.add_edge(START, "Decompose")
1✔
38
graph.add_edge("Decompose", "VectorSearch")
1✔
39
graph.add_edge("VectorSearch", "GeneratePromQL")
1✔
40
graph.add_edge("GeneratePromQL", "ExecutePromQL")
1✔
41
graph.add_edge("ExecutePromQL", "Summarize")
1✔
42
graph.add_edge("Summarize", END)
1✔
43

44
# Compile graph
45
cyclops = graph.compile()
1✔
46

47
# Run example (main)
48
if __name__ == "__main__":
1✔
NEW
49
    import asyncio
×
50

NEW
51
    async def run_agent() -> None:
×
52
        # Example user prompt
NEW
53
        user_prompt = "Show average CPU usage of Kubernetes nodes"
×
54

55
        # Initial state
NEW
56
        input_state = {"user_prompt": user_prompt}
×
57

NEW
58
        print("\nRunning Cyclops agent...")
×
NEW
59
        result = await cyclops.invoke(input_state) # type: ignore
×
60

NEW
61
        print("\nFinal state:")
×
NEW
62
        for key, value in result.items():
×
NEW
63
            print(f"{key}: {value}")
×
64

NEW
65
    asyncio.run(run_agent())
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc