cognitrix 0.2.4__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognitrix-0.2.6/PKG-INFO +257 -0
- cognitrix-0.2.6/README.md +201 -0
- cognitrix-0.2.6/cognitrix/__init__.py +23 -0
- cognitrix-0.2.6/cognitrix/agents/__init__.py +15 -0
- cognitrix-0.2.6/cognitrix/agents/base.py +501 -0
- cognitrix-0.2.6/cognitrix/agents/capability_registry.py +189 -0
- {cognitrix-0.2.4 → cognitrix-0.2.6}/cognitrix/agents/core.py +2 -4
- cognitrix-0.2.6/cognitrix/agents/evaluator.py +9 -0
- cognitrix-0.2.6/cognitrix/agents/generators.py +18 -0
- cognitrix-0.2.6/cognitrix/agents/router.py +264 -0
- cognitrix-0.2.6/cognitrix/agents/templates.py +17 -0
- cognitrix-0.2.6/cognitrix/api/main.py +36 -0
- cognitrix-0.2.6/cognitrix/api/routes/__init__.py +18 -0
- cognitrix-0.2.6/cognitrix/api/routes/agents.py +95 -0
- cognitrix-0.2.6/cognitrix/api/routes/auth.py +87 -0
- cognitrix-0.2.6/cognitrix/api/routes/base.py +7 -0
- cognitrix-0.2.6/cognitrix/api/routes/providers.py +23 -0
- cognitrix-0.2.6/cognitrix/api/routes/public.py +3 -0
- cognitrix-0.2.6/cognitrix/api/routes/sessions.py +88 -0
- cognitrix-0.2.6/cognitrix/api/routes/tasks.py +63 -0
- cognitrix-0.2.6/cognitrix/api/routes/teams.py +70 -0
- cognitrix-0.2.6/cognitrix/api/routes/tools.py +24 -0
- cognitrix-0.2.6/cognitrix/celery_worker.py +114 -0
- cognitrix-0.2.6/cognitrix/cli/__init__.py +34 -0
- cognitrix-0.2.6/cognitrix/cli/args.py +95 -0
- cognitrix-0.2.6/cognitrix/cli/core.py +194 -0
- cognitrix-0.2.6/cognitrix/cli/handlers.py +167 -0
- cognitrix-0.2.6/cognitrix/cli/handlers_skills.py +290 -0
- cognitrix-0.2.6/cognitrix/cli/main.py +50 -0
- cognitrix-0.2.6/cognitrix/cli/shell.py +772 -0
- cognitrix-0.2.6/cognitrix/cli/tui.py +715 -0
- cognitrix-0.2.6/cognitrix/cli/ui.py +97 -0
- cognitrix-0.2.6/cognitrix/cli/utils.py +42 -0
- cognitrix-0.2.6/cognitrix/common/__init__.py +41 -0
- cognitrix-0.2.6/cognitrix/common/constants.py +9 -0
- cognitrix-0.2.6/cognitrix/common/safe_exec.py +208 -0
- cognitrix-0.2.6/cognitrix/common/security.py +125 -0
- cognitrix-0.2.6/cognitrix/common/utils.py +44 -0
- cognitrix-0.2.6/cognitrix/config.py +352 -0
- cognitrix-0.2.6/cognitrix/mcp/__init__.py +195 -0
- cognitrix-0.2.6/cognitrix/mcp/api.py +216 -0
- cognitrix-0.2.6/cognitrix/mcp/client.py +404 -0
- cognitrix-0.2.6/cognitrix/mcp/manager.py +185 -0
- cognitrix-0.2.6/cognitrix/mcp/server_manager.py +231 -0
- cognitrix-0.2.6/cognitrix/mcp/status.py +97 -0
- cognitrix-0.2.6/cognitrix/mcp/tools.py +164 -0
- cognitrix-0.2.6/cognitrix/memory/__init__.py +13 -0
- cognitrix-0.2.6/cognitrix/memory/base.py +56 -0
- cognitrix-0.2.6/cognitrix/memory/chroma_store.py +194 -0
- cognitrix-0.2.6/cognitrix/memory/hybrid_context.py +277 -0
- cognitrix-0.2.6/cognitrix/models/__init__.py +7 -0
- cognitrix-0.2.6/cognitrix/models/agent.py +118 -0
- cognitrix-0.2.6/cognitrix/models/session.py +82 -0
- cognitrix-0.2.6/cognitrix/models/tool.py +131 -0
- cognitrix-0.2.6/cognitrix/models/user.py +8 -0
- cognitrix-0.2.6/cognitrix/planning/structured_planner.py +260 -0
- cognitrix-0.2.6/cognitrix/prompts/evaluation.py +48 -0
- cognitrix-0.2.6/cognitrix/prompts/generator.py +104 -0
- cognitrix-0.2.6/cognitrix/prompts/instructions.py +77 -0
- cognitrix-0.2.6/cognitrix/prompts/meta.py +143 -0
- cognitrix-0.2.6/cognitrix/prompts/planning.py +114 -0
- cognitrix-0.2.6/cognitrix/providers/__init__.py +7 -0
- cognitrix-0.2.6/cognitrix/providers/base.py +601 -0
- cognitrix-0.2.6/cognitrix/safety/approval_gate.py +295 -0
- cognitrix-0.2.6/cognitrix/safety/destructive_ops.py +160 -0
- cognitrix-0.2.6/cognitrix/sessions/__init__.py +3 -0
- cognitrix-0.2.6/cognitrix/sessions/base.py +460 -0
- cognitrix-0.2.6/cognitrix/sessions/context.py +143 -0
- cognitrix-0.2.6/cognitrix/skills/__init__.py +25 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/brave-search/SKILL.md +39 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/brave-search/scripts/search.py +70 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/code-review/SKILL.md +59 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/delete-path/SKILL.md +42 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/edit-file/SKILL.md +54 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/grep/SKILL.md +69 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/hot-key/SKILL.md +52 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/hot-key/scripts/combo.py +37 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/internet-search/SKILL.md +42 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/internet-search/scripts/search.py +59 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/key-press/SKILL.md +45 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/key-press/scripts/press.py +37 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/list-dir/SKILL.md +60 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-click/SKILL.md +45 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-click/scripts/click.py +43 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-double-click/SKILL.md +45 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-double-click/scripts/double_click.py +43 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-right-click/SKILL.md +45 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/mouse-right-click/scripts/right_click.py +43 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/open-website/SKILL.md +34 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/open-website/scripts/open.py +63 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/play-youtube/SKILL.md +40 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/play-youtube/scripts/search.py +63 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/research/SKILL.md +78 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/summarize-document/SKILL.md +63 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/take-screenshot/SKILL.md +43 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/take-screenshot/scripts/capture.py +41 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/text-input/SKILL.md +43 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/text-input/scripts/type.py +37 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/web-scraper/SKILL.md +50 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/web-scraper/scripts/scrape.py +70 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/wikipedia/SKILL.md +47 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/wikipedia/scripts/search.py +49 -0
- cognitrix-0.2.6/cognitrix/skills/builtin/write-file/SKILL.md +50 -0
- cognitrix-0.2.6/cognitrix/skills/executor.py +762 -0
- cognitrix-0.2.6/cognitrix/skills/loaders.py +360 -0
- cognitrix-0.2.6/cognitrix/skills/manager.py +330 -0
- cognitrix-0.2.6/cognitrix/skills/models.py +115 -0
- cognitrix-0.2.6/cognitrix/skills/parser.py +248 -0
- cognitrix-0.2.6/cognitrix/tasks/__init__.py +24 -0
- cognitrix-0.2.6/cognitrix/tasks/base.py +171 -0
- cognitrix-0.2.6/cognitrix/tasks/handler.py +475 -0
- cognitrix-0.2.6/cognitrix/tasks/tracker.py +223 -0
- cognitrix-0.2.6/cognitrix/teams/__init__.py +3 -0
- cognitrix-0.2.6/cognitrix/teams/base.py +372 -0
- cognitrix-0.2.6/cognitrix/teams/workflow_executor.py +257 -0
- cognitrix-0.2.6/cognitrix/tools/__init__.py +36 -0
- cognitrix-0.2.6/cognitrix/tools/base.py +72 -0
- cognitrix-0.2.6/cognitrix/tools/mcp.py +76 -0
- cognitrix-0.2.6/cognitrix/tools/misc.py +879 -0
- cognitrix-0.2.6/cognitrix/tools/resilient_tool_wrapper.py +152 -0
- cognitrix-0.2.6/cognitrix/tools/skill_tool.py +200 -0
- cognitrix-0.2.6/cognitrix/tools/tool.py +63 -0
- cognitrix-0.2.6/cognitrix/tools/utils.py +101 -0
- cognitrix-0.2.6/cognitrix/utils/__init__.py +311 -0
- cognitrix-0.2.6/cognitrix/utils/core.py +14 -0
- cognitrix-0.2.6/cognitrix/utils/embedding_model.py +43 -0
- cognitrix-0.2.6/cognitrix/utils/llm_response.py +123 -0
- cognitrix-0.2.6/cognitrix/utils/retry.py +142 -0
- cognitrix-0.2.6/cognitrix/utils/sse.py +203 -0
- cognitrix-0.2.6/cognitrix/utils/tokens.py +25 -0
- cognitrix-0.2.6/cognitrix/utils/ws.py +275 -0
- {cognitrix-0.2.4 → cognitrix-0.2.6}/pyproject.toml +62 -25
- cognitrix-0.2.4/PKG-INFO +0 -162
- cognitrix-0.2.4/README.md +0 -110
- cognitrix-0.2.4/cognitrix/__init__.py +0 -3
- cognitrix-0.2.4/cognitrix/agents/__init__.py +0 -2
- cognitrix-0.2.4/cognitrix/agents/assistant.py +0 -11
- cognitrix-0.2.4/cognitrix/agents/base.py +0 -422
- cognitrix-0.2.4/cognitrix/agents/templates.py +0 -364
- cognitrix-0.2.4/cognitrix/app.py +0 -19
- cognitrix-0.2.4/cognitrix/cli.py +0 -239
- cognitrix-0.2.4/cognitrix/config.py +0 -30
- cognitrix-0.2.4/cognitrix/llms/__init__.py +0 -11
- cognitrix-0.2.4/cognitrix/llms/anthropic_llm.py +0 -119
- cognitrix-0.2.4/cognitrix/llms/base.py +0 -90
- cognitrix-0.2.4/cognitrix/llms/clarifai_llm.py +0 -54
- cognitrix-0.2.4/cognitrix/llms/cohere_llm.py +0 -74
- cognitrix-0.2.4/cognitrix/llms/google_llm.py +0 -117
- cognitrix-0.2.4/cognitrix/llms/groq_llm.py +0 -106
- cognitrix-0.2.4/cognitrix/llms/local_llm.py +0 -123
- cognitrix-0.2.4/cognitrix/llms/mindsdb_llm.py +0 -40
- cognitrix-0.2.4/cognitrix/llms/ollama_llm.py +0 -115
- cognitrix-0.2.4/cognitrix/llms/openai_llm.py +0 -131
- cognitrix-0.2.4/cognitrix/llms/session.py +0 -69
- cognitrix-0.2.4/cognitrix/llms/together_llm.py +0 -93
- cognitrix-0.2.4/cognitrix/tasks/__init__.py +0 -1
- cognitrix-0.2.4/cognitrix/tasks/base.py +0 -41
- cognitrix-0.2.4/cognitrix/tools/__init__.py +0 -12
- cognitrix-0.2.4/cognitrix/tools/base.py +0 -76
- cognitrix-0.2.4/cognitrix/tools/misc.py +0 -657
- cognitrix-0.2.4/cognitrix/tools/python.py +0 -85
- cognitrix-0.2.4/cognitrix/tools/tool.py +0 -32
- cognitrix-0.2.4/cognitrix/transcriber.py +0 -107
- cognitrix-0.2.4/cognitrix/utils/__init__.py +0 -199
- {cognitrix-0.2.4 → cognitrix-0.2.6}/LICENSE +0 -0
cognitrix-0.2.6/PKG-INFO
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cognitrix
|
|
3
|
+
Version: 0.2.6
|
|
4
|
+
Summary: Package for creating AI Agents using llms
|
|
5
|
+
License: Apache2
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: cognitrix,ai,agents,ai agents,ai-agents,llms,autonomous agents
|
|
8
|
+
Author: theonlyamos
|
|
9
|
+
Author-email: theonlyamos@gmail.com
|
|
10
|
+
Requires-Python: >=3.11,<3.14
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Dist: aiofiles (>=23.2.1,<24.0.0)
|
|
23
|
+
Requires-Dist: aiohttp (>=3.9.3,<4.0.0)
|
|
24
|
+
Requires-Dist: bcrypt (>=4.3.0,<5.0.0)
|
|
25
|
+
Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
|
|
26
|
+
Requires-Dist: celery[redis] (>=5.4.0,<6.0.0)
|
|
27
|
+
Requires-Dist: chromadb (>=1.5.0,<2.0.0)
|
|
28
|
+
Requires-Dist: fastapi (>=0.112.0,<0.113.0)
|
|
29
|
+
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
30
|
+
Requires-Dist: mcp[cli] (>=1.9.1,<2.0.0)
|
|
31
|
+
Requires-Dist: numpy (>=2.0.0,<3.0.0)
|
|
32
|
+
Requires-Dist: odbms (==0.5.2)
|
|
33
|
+
Requires-Dist: openai (>=2.24.0,<3.0.0)
|
|
34
|
+
Requires-Dist: pillow (>=10.2.0,<11.0.0)
|
|
35
|
+
Requires-Dist: pyautogui (>=0.9.54,<0.10.0)
|
|
36
|
+
Requires-Dist: pydantic (>=2.6.2,<3.0.0)
|
|
37
|
+
Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
|
|
38
|
+
Requires-Dist: pymupdf (>=1.27.2,<2.0.0)
|
|
39
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
40
|
+
Requires-Dist: python-multipart (>=0.0.9,<0.0.10)
|
|
41
|
+
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
42
|
+
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
43
|
+
Requires-Dist: rich (>=13.7.1)
|
|
44
|
+
Requires-Dist: sentence-transformers (>=5.2.0,<6.0.0)
|
|
45
|
+
Requires-Dist: sse-starlette (>=2.1.2,<3.0.0)
|
|
46
|
+
Requires-Dist: tavily-python (>=0.3.3,<0.4.0)
|
|
47
|
+
Requires-Dist: textual (>=8.0.1,<9.0.0)
|
|
48
|
+
Requires-Dist: uvicorn (>=0.30.1,<0.31.0)
|
|
49
|
+
Requires-Dist: wikipedia (>=1.4.0,<2.0.0)
|
|
50
|
+
Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
|
|
51
|
+
Project-URL: Bug Tracker, https://github.com/theonlyamos/cognitrix/issues
|
|
52
|
+
Project-URL: Homepage, https://github.com/theonlyamos/cognitrix
|
|
53
|
+
Project-URL: Repository, https://github.com/theonlyamos/cognitrix
|
|
54
|
+
Description-Content-Type: text/markdown
|
|
55
|
+
|
|
56
|
+
# Cognitrix
|
|
57
|
+
|
|
58
|
+
Cognitrix is an open-source autonomous AI agents orchestrator built in Python. It allows you to create and manage AI agents with ease and integrates seamlessly with large language models (LLMs) from various providers.
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- **Agent Creation and Management:** Create, list, and load AI agents with customizable names, tasks, and configurations.
|
|
63
|
+
- **LLM Integration:** Integrates with multiple LLM providers via OpenRouter (200+ models including OpenAI, Anthropic, Google, Meta, Mistral) plus local models via Ollama.
|
|
64
|
+
- **Modular Architecture:** Easily extensible, allowing the addition of new tools, agents, and LLM integrations.
|
|
65
|
+
- **Conversational Interface:** Interact with AI agents through a command-line interface, providing queries and receiving responses.
|
|
66
|
+
- **Tool Integration:** Agents can utilize a variety of tools, including calculators, web searches, file system browsers, and more.
|
|
67
|
+
- **Autonomous Agent Mode:** Agents can operate autonomously, visually perceiving the screen, interacting with UI elements, and performing tasks.
|
|
68
|
+
- **Multimodal Support:** Handles both text and image inputs/outputs, enabling multimodal interactions.
|
|
69
|
+
|
|
70
|
+
## Architecture
|
|
71
|
+
|
|
72
|
+
Cognitrix's architecture is designed to be highly modular and extensible:
|
|
73
|
+
|
|
74
|
+
- **Agents:** The base `Agent` class is for creating and managing AI agents.
|
|
75
|
+
- **LLMs:** Provider classes for OpenRouter (primary - 200+ models), OpenAI (direct), and Ollama (local).
|
|
76
|
+
- **Tools:** A set of tools that agents can utilize. Each tool has a `category` attribute for grouping and management.
|
|
77
|
+
- **Templates:** Customizable prompt templates guide the behavior and output formats of LLMs.
|
|
78
|
+
|
|
79
|
+
More tools can be added by creating new classes that inherit from the `Tool` base class and specifying a unique `category`.
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
**Prerequisites**
|
|
84
|
+
|
|
85
|
+
- **Python 3.11–3.13** (the package will not build on 3.10 or lower).
|
|
86
|
+
- **Node.js 18+** and a package manager (this repo uses **pnpm**) — only needed to build the web UI from source.
|
|
87
|
+
- **Poetry** — only needed for building from source.
|
|
88
|
+
- **Redis** — only needed if you use the background task API (Celery worker).
|
|
89
|
+
|
|
90
|
+
**Install with pip**:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install cognitrix
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Build from source**:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/theonlyamos/cognitrix.git
|
|
100
|
+
cd cognitrix/frontend
|
|
101
|
+
pnpm install
|
|
102
|
+
pnpm run build
|
|
103
|
+
cd ..
|
|
104
|
+
pip install .
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Install directly from github**:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install https://github.com/theonlyamos/cognitrix/archive/main.zip
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Build the Docker Image**:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/theonlyamos/cognitrix.git
|
|
117
|
+
cd cognitrix
|
|
118
|
+
docker build -t cognitrix .
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Usage
|
|
122
|
+
|
|
123
|
+
**Fill these environment variables as needed**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
OPENAI_API_KEY=
|
|
127
|
+
CO_API_KEY=
|
|
128
|
+
TAVILY_API_KEY=
|
|
129
|
+
CLARIFAI_ACCESS_TOKEN=
|
|
130
|
+
GROQ_API_KEY=
|
|
131
|
+
GOOGLE_API_KEY=
|
|
132
|
+
NEWSAPI_API_KEY=
|
|
133
|
+
ANTHROPIC_API_KEY=
|
|
134
|
+
DEEPGRAM_API_KEY=
|
|
135
|
+
MINDSDB_API_KEY=
|
|
136
|
+
BRAVE_SEARCH_API_KEY=
|
|
137
|
+
AIMLAPI_API_KEY=
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
To run Cognitrix with default settings:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
cognitrix
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Access the Web UI**
|
|
147
|
+
|
|
148
|
+
To run with web interface
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cognitrix --ui web
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Open your web browser and go to `http://localhost:8000` to access the web UI.
|
|
155
|
+
|
|
156
|
+
**Run the Docker Container**
|
|
157
|
+
|
|
158
|
+
After building the image, you can run the container with:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
docker run -p 8000:8000 cognitrix
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This command maps port 8000 of the container to port 8000 on your host machine.
|
|
165
|
+
|
|
166
|
+
To choose an LLM provider, pass `--provider` (config is read from the environment —
|
|
167
|
+
`AI_PROVIDER`, `<PROVIDER>_BASE_URL`, `<PROVIDER>_API_KEY`, `<PROVIDER>_MODEL`):
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
cognitrix --provider openrouter
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
To list created agents:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
cognitrix agents -l
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
To list available tools:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
cognitrix tools -l
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
To run Cognitrix with a specific provider:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
cognitrix --provider <provider_name>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
To run Cognitrix with a specific agent:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
cognitrix --agent <agent_name>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
To run Cognitrix with a category of tools:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
cognitrix --load-tools "web"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
To run Cognitrix with categories of tools:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
cognitrix --load-tools "web,general"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
To create a new agent:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
cognitrix agents --new
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
For more options and usage details, use the help command:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
cognitrix --help
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Web UI
|
|
222
|
+
|
|
223
|
+
Cognitrix includes a web UI built with React, TypeScript, and Vite. This UI allows users to interact with the AI agents and manage their configurations easily.
|
|
224
|
+
|
|
225
|
+
### Development
|
|
226
|
+
|
|
227
|
+
For development purposes, you can also run the web UI locally without Docker. Ensure you have Node.js 18+ and pnpm installed, then follow these steps:
|
|
228
|
+
|
|
229
|
+
1. **Install Dependencies**:
|
|
230
|
+
Navigate to the `frontend` directory and run:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
pnpm install
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
2. **Start the Development Server**:
|
|
237
|
+
Run the following command to start the development server:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
pnpm run dev
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
3. **Access the Development Server**:
|
|
244
|
+
Open your web browser and go to `http://localhost:5173` to view the web UI in development mode.
|
|
245
|
+
|
|
246
|
+
## Contributing
|
|
247
|
+
|
|
248
|
+
Cognitrix is open source and contributions are welcome! Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
This project is licensed under the Apache License 2.0. See [LICENSE](LICENSE) for more information.
|
|
253
|
+
|
|
254
|
+
## Acknowledgments
|
|
255
|
+
|
|
256
|
+
Cognitrix was created by [Amos Amissah](https://github.com/theonlyamos) and is inspired by projects like AutoGPT and GPTEngineer. Special thanks to the open-source community and AI companies providing LLM APIs.
|
|
257
|
+
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Cognitrix
|
|
2
|
+
|
|
3
|
+
Cognitrix is an open-source autonomous AI agents orchestrator built in Python. It allows you to create and manage AI agents with ease and integrates seamlessly with large language models (LLMs) from various providers.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Agent Creation and Management:** Create, list, and load AI agents with customizable names, tasks, and configurations.
|
|
8
|
+
- **LLM Integration:** Integrates with multiple LLM providers via OpenRouter (200+ models including OpenAI, Anthropic, Google, Meta, Mistral) plus local models via Ollama.
|
|
9
|
+
- **Modular Architecture:** Easily extensible, allowing the addition of new tools, agents, and LLM integrations.
|
|
10
|
+
- **Conversational Interface:** Interact with AI agents through a command-line interface, providing queries and receiving responses.
|
|
11
|
+
- **Tool Integration:** Agents can utilize a variety of tools, including calculators, web searches, file system browsers, and more.
|
|
12
|
+
- **Autonomous Agent Mode:** Agents can operate autonomously, visually perceiving the screen, interacting with UI elements, and performing tasks.
|
|
13
|
+
- **Multimodal Support:** Handles both text and image inputs/outputs, enabling multimodal interactions.
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
Cognitrix's architecture is designed to be highly modular and extensible:
|
|
18
|
+
|
|
19
|
+
- **Agents:** The base `Agent` class is for creating and managing AI agents.
|
|
20
|
+
- **LLMs:** Provider classes for OpenRouter (primary - 200+ models), OpenAI (direct), and Ollama (local).
|
|
21
|
+
- **Tools:** A set of tools that agents can utilize. Each tool has a `category` attribute for grouping and management.
|
|
22
|
+
- **Templates:** Customizable prompt templates guide the behavior and output formats of LLMs.
|
|
23
|
+
|
|
24
|
+
More tools can be added by creating new classes that inherit from the `Tool` base class and specifying a unique `category`.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
**Prerequisites**
|
|
29
|
+
|
|
30
|
+
- **Python 3.11–3.13** (the package will not build on 3.10 or lower).
|
|
31
|
+
- **Node.js 18+** and a package manager (this repo uses **pnpm**) — only needed to build the web UI from source.
|
|
32
|
+
- **Poetry** — only needed for building from source.
|
|
33
|
+
- **Redis** — only needed if you use the background task API (Celery worker).
|
|
34
|
+
|
|
35
|
+
**Install with pip**:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install cognitrix
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Build from source**:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/theonlyamos/cognitrix.git
|
|
45
|
+
cd cognitrix/frontend
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm run build
|
|
48
|
+
cd ..
|
|
49
|
+
pip install .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Install directly from github**:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install https://github.com/theonlyamos/cognitrix/archive/main.zip
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Build the Docker Image**:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/theonlyamos/cognitrix.git
|
|
62
|
+
cd cognitrix
|
|
63
|
+
docker build -t cognitrix .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage
|
|
67
|
+
|
|
68
|
+
**Fill these environment variables as needed**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
OPENAI_API_KEY=
|
|
72
|
+
CO_API_KEY=
|
|
73
|
+
TAVILY_API_KEY=
|
|
74
|
+
CLARIFAI_ACCESS_TOKEN=
|
|
75
|
+
GROQ_API_KEY=
|
|
76
|
+
GOOGLE_API_KEY=
|
|
77
|
+
NEWSAPI_API_KEY=
|
|
78
|
+
ANTHROPIC_API_KEY=
|
|
79
|
+
DEEPGRAM_API_KEY=
|
|
80
|
+
MINDSDB_API_KEY=
|
|
81
|
+
BRAVE_SEARCH_API_KEY=
|
|
82
|
+
AIMLAPI_API_KEY=
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
To run Cognitrix with default settings:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cognitrix
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Access the Web UI**
|
|
92
|
+
|
|
93
|
+
To run with web interface
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
cognitrix --ui web
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Open your web browser and go to `http://localhost:8000` to access the web UI.
|
|
100
|
+
|
|
101
|
+
**Run the Docker Container**
|
|
102
|
+
|
|
103
|
+
After building the image, you can run the container with:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
docker run -p 8000:8000 cognitrix
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This command maps port 8000 of the container to port 8000 on your host machine.
|
|
110
|
+
|
|
111
|
+
To choose an LLM provider, pass `--provider` (config is read from the environment —
|
|
112
|
+
`AI_PROVIDER`, `<PROVIDER>_BASE_URL`, `<PROVIDER>_API_KEY`, `<PROVIDER>_MODEL`):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cognitrix --provider openrouter
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
To list created agents:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
cognitrix agents -l
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
To list available tools:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
cognitrix tools -l
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
To run Cognitrix with a specific provider:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cognitrix --provider <provider_name>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
To run Cognitrix with a specific agent:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cognitrix --agent <agent_name>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
To run Cognitrix with a category of tools:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
cognitrix --load-tools "web"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
To run Cognitrix with categories of tools:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cognitrix --load-tools "web,general"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
To create a new agent:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
cognitrix agents --new
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
For more options and usage details, use the help command:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cognitrix --help
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Web UI
|
|
167
|
+
|
|
168
|
+
Cognitrix includes a web UI built with React, TypeScript, and Vite. This UI allows users to interact with the AI agents and manage their configurations easily.
|
|
169
|
+
|
|
170
|
+
### Development
|
|
171
|
+
|
|
172
|
+
For development purposes, you can also run the web UI locally without Docker. Ensure you have Node.js 18+ and pnpm installed, then follow these steps:
|
|
173
|
+
|
|
174
|
+
1. **Install Dependencies**:
|
|
175
|
+
Navigate to the `frontend` directory and run:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
pnpm install
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
2. **Start the Development Server**:
|
|
182
|
+
Run the following command to start the development server:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pnpm run dev
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
3. **Access the Development Server**:
|
|
189
|
+
Open your web browser and go to `http://localhost:5173` to view the web UI in development mode.
|
|
190
|
+
|
|
191
|
+
## Contributing
|
|
192
|
+
|
|
193
|
+
Cognitrix is open source and contributions are welcome! Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
This project is licensed under the Apache License 2.0. See [LICENSE](LICENSE) for more information.
|
|
198
|
+
|
|
199
|
+
## Acknowledgments
|
|
200
|
+
|
|
201
|
+
Cognitrix was created by [Amos Amissah](https://github.com/theonlyamos) and is inspired by projects like AutoGPT and GPTEngineer. Special thanks to the open-source community and AI companies providing LLM APIs.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .agents import Agent as Agent
|
|
2
|
+
from .providers import LLM as LLM
|
|
3
|
+
from .providers import LLMResponse as LLMResponse
|
|
4
|
+
from .tools import Tool as Tool
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Backward compatibility aliases
|
|
8
|
+
def _llm_openai(): return LLM.load_llm("openai")
|
|
9
|
+
def _llm_openrouter(): return LLM.load_llm("openrouter")
|
|
10
|
+
def _llm_ollama(): return LLM.load_llm("ollama")
|
|
11
|
+
OpenAI = _llm_openai
|
|
12
|
+
OpenRouter = _llm_openrouter
|
|
13
|
+
Ollama = _llm_ollama
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"Tool",
|
|
17
|
+
"Agent",
|
|
18
|
+
"LLM",
|
|
19
|
+
"LLMResponse",
|
|
20
|
+
"OpenAI",
|
|
21
|
+
"OpenRouter",
|
|
22
|
+
"Ollama",
|
|
23
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from .base import Agent as Agent
|
|
2
|
+
from .evaluator import Evaluator as Evaluator
|
|
3
|
+
from .generators import (
|
|
4
|
+
PromptGenerator as PromptGenerator,
|
|
5
|
+
)
|
|
6
|
+
from .generators import (
|
|
7
|
+
TaskInstructor as TaskInstructor,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"Agent",
|
|
12
|
+
"PromptGenerator",
|
|
13
|
+
"TaskInstructor",
|
|
14
|
+
"Evaluator",
|
|
15
|
+
]
|