diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 29694dd..e202461 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -2,7 +2,8 @@ "permissions": { "allow": [ "Bash(git -C \"C:/Users/ADMIN/Downloads/new projects/project7.1\" status)", - "Bash(git -C \"C:/Users/ADMIN/Downloads/new projects/project7.1\" log --oneline -5)" + "Bash(git -C \"C:/Users/ADMIN/Downloads/new projects/project7.1\" log --oneline -5)", + "Bash(python *)" ] } } diff --git a/README.md b/README.md index 3d457a3..361e9cd 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,15 @@ Quick StartToolsMethodology • - Use Cases • - Examples + Security & Scope • + Use Cases

--- ## 🧠 What is CLAW ARGUS? -**CLAW ARGUS** is an enterprise-grade, autonomous AI research agent. It performs multi-layered investigations across the web, cross-validates findings, detects bias, extracts structured entities, and generates professional intelligence reports — all autonomously. +**CLAW ARGUS** is an autonomous AI research agent. It performs multi-layered investigations across the public web, cross-validates findings, detects bias, extracts structured entities, and generates professional intelligence reports. Think of it as your personal **100-eyed research analyst** that never sleeps, never gets tired, and processes information from multiple sources simultaneously. @@ -47,7 +47,7 @@ Think of it as your personal **100-eyed research analyst** that never sleeps, ne ### 🔍 Multi-Engine Search Searches across **DuckDuckGo**, **Wikipedia**, and **Wikidata** simultaneously for maximum coverage -### 🧬 Entity Extraction +### 🧬 Entity Extraction Regex-based NER pulls out **people, organizations, dates, monetary values, percentages, emails, and URLs** ### 🛡️ Bias Detection @@ -74,7 +74,6 @@ Structured intelligence reports with **confidence scoring, risk assessment, and - ⚡ **In-memory caching** with 5-minute TTL — no redundant API calls - 🔄 **Retry with exponential backoff** — resilient against transient failures - 🧩 **7 modular tools** — each independently testable and extensible -- 📦 **Minimal dependencies** — only `requests` --- @@ -83,14 +82,17 @@ Structured intelligence reports with **confidence scoring, risk assessment, and ### Prerequisites - Python 3.10+ -- An OpenAI API key (or any LLM provider) +- An OpenAI API key (or compatible LLM provider) ### Installation ```bash # Clone the repository -git clone https://github.com/ARGURAIgent/Claw-Argus.git -cd ARGURAI +git clone https://github.com/ClawArgus/ClawArgus +cd ClawArgus + +# Install dependencies +pip install -r requirements.txt # Set your API key export OPENAI_API_KEY="your-key-here" # Linux/Mac @@ -98,6 +100,15 @@ set OPENAI_API_KEY=your-key-here # Windows CMD $env:OPENAI_API_KEY="your-key-here" # PowerShell ``` +### Dependencies + +Runtime deps are intentionally small: + +- **`requests`** — HTTP client for search and fetch +- **An LLM SDK of your choice** (e.g. `openai`) — for the agent loop + +There is no hidden agent framework pulling in a deep dependency tree. The tool functions in `argus_agent.py` are plain Python and can be driven by any LLM orchestrator you prefer. + ### Run ```bash @@ -117,7 +128,7 @@ ARGUS comes equipped with **7 specialized tools** the agent invokes autonomously | # | Tool | Description | |---|------|-------------| | 1 | `web_search` | Multi-engine search across DuckDuckGo, Wikipedia, and Wikidata with caching | -| 2 | `fetch_url_content` | Deep content extraction with HTML stripping, structural analysis, and deduplication | +| 2 | `fetch_url_content` | Content extraction with HTML stripping, structural analysis, and deduplication | | 3 | `wikipedia_summary` | Dedicated Wikipedia deep-dive with categories, metadata, and reliability assessment | | 4 | `extract_entities` | Regex-based NER: people/orgs, dates, money, percentages, emails, URLs | | 5 | `analyze_text` | Sentiment + bias detection + bigrams + readability + thematic classification | @@ -163,6 +174,28 @@ Sources are prioritized by reliability: --- +## 🔒 Security & Scope + +ARGUS is designed as a **local research tool**. Please read this section before deploying it anywhere that accepts untrusted input. + +### Intended use +- Running locally or in a trusted environment where the operator controls the research prompt. +- Authorized OSINT, market research, academic review, and similar analyst workflows. + +### Not intended (without additional hardening) +- Public-facing services or multi-tenant deployments. `fetch_url_content` will retrieve any URL the agent decides to visit, which means an attacker who controls the prompt or the search results could attempt **Server-Side Request Forgery (SSRF)** against internal hosts (`127.0.0.1`, `169.254.169.254`, RFC1918 ranges, etc.). If you deploy ARGUS as a service, put `fetch_url_content` behind an allowlist, block private IP ranges after DNS resolution, and cap redirects. + +### Outbound HTTP identification +ARGUS identifies itself in the `User-Agent` header as `ARGUS/` with a link back to this repository. It does not spoof a browser. Some sites may rate-limit or block non-browser clients; respect `robots.txt` and each site's terms of service. + +### API keys +The agent reads `OPENAI_API_KEY` (or your chosen provider key) from the environment. Never commit keys, and never paste a production key into a prompt that gets logged. + +### Repository hygiene +`.claude/`, `.env`, local settings, and cache files should be listed in `.gitignore`. Do not commit machine-specific auto-approval files. + +--- + ## 💼 Use Cases ### 📈 Market Research & Competitive Intelligence @@ -183,7 +216,6 @@ Conduct literature reviews and technical deep-dives. ARGUS decomposes research q ```python from argus_agent import argus_agent -# Run a research task result = argus_agent.run( "What are the latest developments in quantum computing? " "Who are the key players and what are the risks?" @@ -195,19 +227,11 @@ print(result) ### Using Individual Tools ```python -from deeprecon_agent import web_search, analyze_text, extract_entities +from argus_agent import web_search, analyze_text, extract_entities -# Search the web results = web_search("autonomous AI agents 2025") -print(results) - -# Analyze text for sentiment and bias analysis = analyze_text("The revolutionary AI breakthrough will transform everything...") -print(analysis) - -# Extract entities from text entities = extract_entities("OpenAI raised $6.6 billion in October 2024...") -print(entities) ``` ### Sample Report Output @@ -235,9 +259,10 @@ print(entities) ## 📁 Project Structure ``` -ARGURAI/ +ClawArgus/ ├── argus_agent.py # Main agent implementation (all tools + agent config) -├── argus_logo.jpg # Agent marketplace image (800×800) +├── argus_logo.jpg # Agent marketplace image (800×800) +├── requirements.txt # Runtime dependencies ├── README.md # This file ├── LICENSE # MIT License └── .gitignore # Git ignore rules @@ -265,6 +290,9 @@ This project is licensed under the **MIT License** — see the [LICENSE](LICENSE ## 🔗 Links +- **Repository:** https://github.com/ClawArgus/ClawArgus +- **Issues & feature requests:** https://github.com/ClawArgus/ClawArgus/issues + ---

diff --git a/argus_agent.py b/argus_agent.py index 0669046..d75746c 100644 --- a/argus_agent.py +++ b/argus_agent.py @@ -7,7 +7,6 @@ detects bias, and generates comprehensive intelligence reports with confidence scoring, source attribution, and exportable markdown output. Named after Argus Panoptes, the all-seeing giant of Greek mythology. -Built on the Swarms framework for production-ready agent orchestration. Author: ARGUS Labs Version: 2.0.0 @@ -18,13 +17,15 @@ import os import re import json import hashlib +import inspect import requests import time import functools from collections import Counter from typing import Dict, List, Optional, Any, Callable from datetime import datetime, timezone -from swarms import Agent + +from openai import OpenAI # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -75,11 +76,7 @@ def _retry(max_attempts: int = 3, delay: float = 1.0): _HEADERS = { - "User-Agent": ( - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/124.0.0.0 Safari/537.36" - ) + "User-Agent": "ARGUS/2.0 (+https://github.com/ClawArgus/ClawArgus)" } _STOP_WORDS = frozenset({ @@ -974,7 +971,108 @@ Prioritize sources in this order: # AGENT INITIALIZATION # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -argus_agent = Agent( +_JSON_TYPE_MAP = { + str: "string", + int: "integer", + float: "number", + bool: "boolean", +} + + +def _build_tool_schema(func: Callable) -> Dict[str, Any]: + sig = inspect.signature(func) + properties: Dict[str, Any] = {} + required: List[str] = [] + for name, param in sig.parameters.items(): + json_type = _JSON_TYPE_MAP.get(param.annotation, "string") + properties[name] = {"type": json_type} + if param.default is inspect.Parameter.empty: + required.append(name) + doc = (func.__doc__ or "").strip().split("\n\n", 1)[0] + return { + "type": "function", + "function": { + "name": func.__name__, + "description": doc[:1024], + "parameters": { + "type": "object", + "properties": properties, + "required": required, + }, + }, + } + + +class ArgusAgent: + """ + Minimal tool-calling loop around the OpenAI Chat Completions API. + + Holds the system prompt, the tool registry, and a .run(task) entry point + that drives the model-tool-model cycle until the model returns a final + answer or max_loops is exceeded. + """ + + def __init__( + self, + agent_name: str, + agent_description: str, + system_prompt: str, + model_name: str, + tools: List[Callable], + max_loops: int = 5, + verbose: bool = True, + ): + self.agent_name = agent_name + self.agent_description = agent_description + self.system_prompt = system_prompt + self.model_name = model_name + self.max_loops = max_loops + self.verbose = verbose + self._tools_by_name = {t.__name__: t for t in tools} + self._tool_schemas = [_build_tool_schema(t) for t in tools] + self._client = OpenAI() + + def run(self, task: str) -> str: + messages: List[Dict[str, Any]] = [ + {"role": "system", "content": self.system_prompt}, + {"role": "user", "content": task}, + ] + + for loop in range(self.max_loops): + response = self._client.chat.completions.create( + model=self.model_name, + messages=messages, + tools=self._tool_schemas, + tool_choice="auto", + ) + msg = response.choices[0].message + messages.append(msg.model_dump(exclude_none=True)) + + if not msg.tool_calls: + return msg.content or "" + + for call in msg.tool_calls: + fn = self._tools_by_name.get(call.function.name) + if self.verbose: + print(f" 🔧 [loop {loop + 1}] {call.function.name}({call.function.arguments})") + if fn is None: + result = f"Unknown tool: {call.function.name}" + else: + try: + args = json.loads(call.function.arguments or "{}") + result = fn(**args) + except Exception as exc: + result = f"Error running {call.function.name}: {exc}" + messages.append({ + "role": "tool", + "tool_call_id": call.id, + "content": str(result), + }) + + return "Max tool loops reached without a final answer." + + +argus_agent = ArgusAgent( agent_name="ARGUS", agent_description=( "ARGUS — The All-Seeing Research & Intelligence Agent v2.0. " @@ -987,13 +1085,6 @@ argus_agent = Agent( system_prompt=ARGUS_SYSTEM_PROMPT, model_name="gpt-4o-mini", max_loops=5, - autosave=True, - verbose=True, - dynamic_temperature_enabled=True, - saved_state_path="argus_state.json", - retry_attempts=3, - context_length=128000, - output_type="string", tools=[ web_search, fetch_url_content, @@ -1003,7 +1094,6 @@ argus_agent = Agent( compare_sources, generate_report, ], - tool_choice="auto", )