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.
Files changed (165) hide show
  1. cognitrix-0.2.6/PKG-INFO +257 -0
  2. cognitrix-0.2.6/README.md +201 -0
  3. cognitrix-0.2.6/cognitrix/__init__.py +23 -0
  4. cognitrix-0.2.6/cognitrix/agents/__init__.py +15 -0
  5. cognitrix-0.2.6/cognitrix/agents/base.py +501 -0
  6. cognitrix-0.2.6/cognitrix/agents/capability_registry.py +189 -0
  7. {cognitrix-0.2.4 → cognitrix-0.2.6}/cognitrix/agents/core.py +2 -4
  8. cognitrix-0.2.6/cognitrix/agents/evaluator.py +9 -0
  9. cognitrix-0.2.6/cognitrix/agents/generators.py +18 -0
  10. cognitrix-0.2.6/cognitrix/agents/router.py +264 -0
  11. cognitrix-0.2.6/cognitrix/agents/templates.py +17 -0
  12. cognitrix-0.2.6/cognitrix/api/main.py +36 -0
  13. cognitrix-0.2.6/cognitrix/api/routes/__init__.py +18 -0
  14. cognitrix-0.2.6/cognitrix/api/routes/agents.py +95 -0
  15. cognitrix-0.2.6/cognitrix/api/routes/auth.py +87 -0
  16. cognitrix-0.2.6/cognitrix/api/routes/base.py +7 -0
  17. cognitrix-0.2.6/cognitrix/api/routes/providers.py +23 -0
  18. cognitrix-0.2.6/cognitrix/api/routes/public.py +3 -0
  19. cognitrix-0.2.6/cognitrix/api/routes/sessions.py +88 -0
  20. cognitrix-0.2.6/cognitrix/api/routes/tasks.py +63 -0
  21. cognitrix-0.2.6/cognitrix/api/routes/teams.py +70 -0
  22. cognitrix-0.2.6/cognitrix/api/routes/tools.py +24 -0
  23. cognitrix-0.2.6/cognitrix/celery_worker.py +114 -0
  24. cognitrix-0.2.6/cognitrix/cli/__init__.py +34 -0
  25. cognitrix-0.2.6/cognitrix/cli/args.py +95 -0
  26. cognitrix-0.2.6/cognitrix/cli/core.py +194 -0
  27. cognitrix-0.2.6/cognitrix/cli/handlers.py +167 -0
  28. cognitrix-0.2.6/cognitrix/cli/handlers_skills.py +290 -0
  29. cognitrix-0.2.6/cognitrix/cli/main.py +50 -0
  30. cognitrix-0.2.6/cognitrix/cli/shell.py +772 -0
  31. cognitrix-0.2.6/cognitrix/cli/tui.py +715 -0
  32. cognitrix-0.2.6/cognitrix/cli/ui.py +97 -0
  33. cognitrix-0.2.6/cognitrix/cli/utils.py +42 -0
  34. cognitrix-0.2.6/cognitrix/common/__init__.py +41 -0
  35. cognitrix-0.2.6/cognitrix/common/constants.py +9 -0
  36. cognitrix-0.2.6/cognitrix/common/safe_exec.py +208 -0
  37. cognitrix-0.2.6/cognitrix/common/security.py +125 -0
  38. cognitrix-0.2.6/cognitrix/common/utils.py +44 -0
  39. cognitrix-0.2.6/cognitrix/config.py +352 -0
  40. cognitrix-0.2.6/cognitrix/mcp/__init__.py +195 -0
  41. cognitrix-0.2.6/cognitrix/mcp/api.py +216 -0
  42. cognitrix-0.2.6/cognitrix/mcp/client.py +404 -0
  43. cognitrix-0.2.6/cognitrix/mcp/manager.py +185 -0
  44. cognitrix-0.2.6/cognitrix/mcp/server_manager.py +231 -0
  45. cognitrix-0.2.6/cognitrix/mcp/status.py +97 -0
  46. cognitrix-0.2.6/cognitrix/mcp/tools.py +164 -0
  47. cognitrix-0.2.6/cognitrix/memory/__init__.py +13 -0
  48. cognitrix-0.2.6/cognitrix/memory/base.py +56 -0
  49. cognitrix-0.2.6/cognitrix/memory/chroma_store.py +194 -0
  50. cognitrix-0.2.6/cognitrix/memory/hybrid_context.py +277 -0
  51. cognitrix-0.2.6/cognitrix/models/__init__.py +7 -0
  52. cognitrix-0.2.6/cognitrix/models/agent.py +118 -0
  53. cognitrix-0.2.6/cognitrix/models/session.py +82 -0
  54. cognitrix-0.2.6/cognitrix/models/tool.py +131 -0
  55. cognitrix-0.2.6/cognitrix/models/user.py +8 -0
  56. cognitrix-0.2.6/cognitrix/planning/structured_planner.py +260 -0
  57. cognitrix-0.2.6/cognitrix/prompts/evaluation.py +48 -0
  58. cognitrix-0.2.6/cognitrix/prompts/generator.py +104 -0
  59. cognitrix-0.2.6/cognitrix/prompts/instructions.py +77 -0
  60. cognitrix-0.2.6/cognitrix/prompts/meta.py +143 -0
  61. cognitrix-0.2.6/cognitrix/prompts/planning.py +114 -0
  62. cognitrix-0.2.6/cognitrix/providers/__init__.py +7 -0
  63. cognitrix-0.2.6/cognitrix/providers/base.py +601 -0
  64. cognitrix-0.2.6/cognitrix/safety/approval_gate.py +295 -0
  65. cognitrix-0.2.6/cognitrix/safety/destructive_ops.py +160 -0
  66. cognitrix-0.2.6/cognitrix/sessions/__init__.py +3 -0
  67. cognitrix-0.2.6/cognitrix/sessions/base.py +460 -0
  68. cognitrix-0.2.6/cognitrix/sessions/context.py +143 -0
  69. cognitrix-0.2.6/cognitrix/skills/__init__.py +25 -0
  70. cognitrix-0.2.6/cognitrix/skills/builtin/brave-search/SKILL.md +39 -0
  71. cognitrix-0.2.6/cognitrix/skills/builtin/brave-search/scripts/search.py +70 -0
  72. cognitrix-0.2.6/cognitrix/skills/builtin/code-review/SKILL.md +59 -0
  73. cognitrix-0.2.6/cognitrix/skills/builtin/delete-path/SKILL.md +42 -0
  74. cognitrix-0.2.6/cognitrix/skills/builtin/edit-file/SKILL.md +54 -0
  75. cognitrix-0.2.6/cognitrix/skills/builtin/grep/SKILL.md +69 -0
  76. cognitrix-0.2.6/cognitrix/skills/builtin/hot-key/SKILL.md +52 -0
  77. cognitrix-0.2.6/cognitrix/skills/builtin/hot-key/scripts/combo.py +37 -0
  78. cognitrix-0.2.6/cognitrix/skills/builtin/internet-search/SKILL.md +42 -0
  79. cognitrix-0.2.6/cognitrix/skills/builtin/internet-search/scripts/search.py +59 -0
  80. cognitrix-0.2.6/cognitrix/skills/builtin/key-press/SKILL.md +45 -0
  81. cognitrix-0.2.6/cognitrix/skills/builtin/key-press/scripts/press.py +37 -0
  82. cognitrix-0.2.6/cognitrix/skills/builtin/list-dir/SKILL.md +60 -0
  83. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-click/SKILL.md +45 -0
  84. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-click/scripts/click.py +43 -0
  85. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-double-click/SKILL.md +45 -0
  86. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-double-click/scripts/double_click.py +43 -0
  87. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-right-click/SKILL.md +45 -0
  88. cognitrix-0.2.6/cognitrix/skills/builtin/mouse-right-click/scripts/right_click.py +43 -0
  89. cognitrix-0.2.6/cognitrix/skills/builtin/open-website/SKILL.md +34 -0
  90. cognitrix-0.2.6/cognitrix/skills/builtin/open-website/scripts/open.py +63 -0
  91. cognitrix-0.2.6/cognitrix/skills/builtin/play-youtube/SKILL.md +40 -0
  92. cognitrix-0.2.6/cognitrix/skills/builtin/play-youtube/scripts/search.py +63 -0
  93. cognitrix-0.2.6/cognitrix/skills/builtin/research/SKILL.md +78 -0
  94. cognitrix-0.2.6/cognitrix/skills/builtin/summarize-document/SKILL.md +63 -0
  95. cognitrix-0.2.6/cognitrix/skills/builtin/take-screenshot/SKILL.md +43 -0
  96. cognitrix-0.2.6/cognitrix/skills/builtin/take-screenshot/scripts/capture.py +41 -0
  97. cognitrix-0.2.6/cognitrix/skills/builtin/text-input/SKILL.md +43 -0
  98. cognitrix-0.2.6/cognitrix/skills/builtin/text-input/scripts/type.py +37 -0
  99. cognitrix-0.2.6/cognitrix/skills/builtin/web-scraper/SKILL.md +50 -0
  100. cognitrix-0.2.6/cognitrix/skills/builtin/web-scraper/scripts/scrape.py +70 -0
  101. cognitrix-0.2.6/cognitrix/skills/builtin/wikipedia/SKILL.md +47 -0
  102. cognitrix-0.2.6/cognitrix/skills/builtin/wikipedia/scripts/search.py +49 -0
  103. cognitrix-0.2.6/cognitrix/skills/builtin/write-file/SKILL.md +50 -0
  104. cognitrix-0.2.6/cognitrix/skills/executor.py +762 -0
  105. cognitrix-0.2.6/cognitrix/skills/loaders.py +360 -0
  106. cognitrix-0.2.6/cognitrix/skills/manager.py +330 -0
  107. cognitrix-0.2.6/cognitrix/skills/models.py +115 -0
  108. cognitrix-0.2.6/cognitrix/skills/parser.py +248 -0
  109. cognitrix-0.2.6/cognitrix/tasks/__init__.py +24 -0
  110. cognitrix-0.2.6/cognitrix/tasks/base.py +171 -0
  111. cognitrix-0.2.6/cognitrix/tasks/handler.py +475 -0
  112. cognitrix-0.2.6/cognitrix/tasks/tracker.py +223 -0
  113. cognitrix-0.2.6/cognitrix/teams/__init__.py +3 -0
  114. cognitrix-0.2.6/cognitrix/teams/base.py +372 -0
  115. cognitrix-0.2.6/cognitrix/teams/workflow_executor.py +257 -0
  116. cognitrix-0.2.6/cognitrix/tools/__init__.py +36 -0
  117. cognitrix-0.2.6/cognitrix/tools/base.py +72 -0
  118. cognitrix-0.2.6/cognitrix/tools/mcp.py +76 -0
  119. cognitrix-0.2.6/cognitrix/tools/misc.py +879 -0
  120. cognitrix-0.2.6/cognitrix/tools/resilient_tool_wrapper.py +152 -0
  121. cognitrix-0.2.6/cognitrix/tools/skill_tool.py +200 -0
  122. cognitrix-0.2.6/cognitrix/tools/tool.py +63 -0
  123. cognitrix-0.2.6/cognitrix/tools/utils.py +101 -0
  124. cognitrix-0.2.6/cognitrix/utils/__init__.py +311 -0
  125. cognitrix-0.2.6/cognitrix/utils/core.py +14 -0
  126. cognitrix-0.2.6/cognitrix/utils/embedding_model.py +43 -0
  127. cognitrix-0.2.6/cognitrix/utils/llm_response.py +123 -0
  128. cognitrix-0.2.6/cognitrix/utils/retry.py +142 -0
  129. cognitrix-0.2.6/cognitrix/utils/sse.py +203 -0
  130. cognitrix-0.2.6/cognitrix/utils/tokens.py +25 -0
  131. cognitrix-0.2.6/cognitrix/utils/ws.py +275 -0
  132. {cognitrix-0.2.4 → cognitrix-0.2.6}/pyproject.toml +62 -25
  133. cognitrix-0.2.4/PKG-INFO +0 -162
  134. cognitrix-0.2.4/README.md +0 -110
  135. cognitrix-0.2.4/cognitrix/__init__.py +0 -3
  136. cognitrix-0.2.4/cognitrix/agents/__init__.py +0 -2
  137. cognitrix-0.2.4/cognitrix/agents/assistant.py +0 -11
  138. cognitrix-0.2.4/cognitrix/agents/base.py +0 -422
  139. cognitrix-0.2.4/cognitrix/agents/templates.py +0 -364
  140. cognitrix-0.2.4/cognitrix/app.py +0 -19
  141. cognitrix-0.2.4/cognitrix/cli.py +0 -239
  142. cognitrix-0.2.4/cognitrix/config.py +0 -30
  143. cognitrix-0.2.4/cognitrix/llms/__init__.py +0 -11
  144. cognitrix-0.2.4/cognitrix/llms/anthropic_llm.py +0 -119
  145. cognitrix-0.2.4/cognitrix/llms/base.py +0 -90
  146. cognitrix-0.2.4/cognitrix/llms/clarifai_llm.py +0 -54
  147. cognitrix-0.2.4/cognitrix/llms/cohere_llm.py +0 -74
  148. cognitrix-0.2.4/cognitrix/llms/google_llm.py +0 -117
  149. cognitrix-0.2.4/cognitrix/llms/groq_llm.py +0 -106
  150. cognitrix-0.2.4/cognitrix/llms/local_llm.py +0 -123
  151. cognitrix-0.2.4/cognitrix/llms/mindsdb_llm.py +0 -40
  152. cognitrix-0.2.4/cognitrix/llms/ollama_llm.py +0 -115
  153. cognitrix-0.2.4/cognitrix/llms/openai_llm.py +0 -131
  154. cognitrix-0.2.4/cognitrix/llms/session.py +0 -69
  155. cognitrix-0.2.4/cognitrix/llms/together_llm.py +0 -93
  156. cognitrix-0.2.4/cognitrix/tasks/__init__.py +0 -1
  157. cognitrix-0.2.4/cognitrix/tasks/base.py +0 -41
  158. cognitrix-0.2.4/cognitrix/tools/__init__.py +0 -12
  159. cognitrix-0.2.4/cognitrix/tools/base.py +0 -76
  160. cognitrix-0.2.4/cognitrix/tools/misc.py +0 -657
  161. cognitrix-0.2.4/cognitrix/tools/python.py +0 -85
  162. cognitrix-0.2.4/cognitrix/tools/tool.py +0 -32
  163. cognitrix-0.2.4/cognitrix/transcriber.py +0 -107
  164. cognitrix-0.2.4/cognitrix/utils/__init__.py +0 -199
  165. {cognitrix-0.2.4 → cognitrix-0.2.6}/LICENSE +0 -0
@@ -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
+ ]