Rohan03 commited on
Commit
59589f0
Β·
verified Β·
1 Parent(s): 2d933e9

docs: add unified capabilities research to COMPILED_RESEARCH.md

Browse files
Files changed (1) hide show
  1. COMPILED_RESEARCH.md +53 -0
COMPILED_RESEARCH.md CHANGED
@@ -286,6 +286,59 @@ No core files edited. No `__init__.py` changes. Drop the file, import it, regist
286
 
287
  ---
288
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  ## Future Research Directions
290
 
291
  ### Papers to Implement Next
 
286
 
287
  ---
288
 
289
+ ## feat: Unified Capabilities β€” 5 Framework Philosophies in One Composable Layer
290
+
291
+ **Date:** 2025-04-28 | **Module:** `unified.py`
292
+
293
+ ### The Five Competing Philosophies
294
+
295
+ | Framework | Philosophy | Their Core Mechanic | Our Implementation | Zero core changes? |
296
+ |-----------|-----------|--------------------|--------------------|-------------------|
297
+ | **LangGraph** | "I want control" | StateGraph with conditional edges, cycles, fan-out/fan-in | `Graph` class: `add_node()`, `add_edge()`, `add_conditional_edge()`, cyclic execution with visit counting | βœ… Calls `Agent.run()` at each node |
298
+ | **CrewAI** | "I want speed" | `Process.sequential` / `Process.hierarchical` / `kickoff_for_each_async` | `parallel()` function: `ThreadPoolExecutor` over `Agent.run()` calls | βœ… Wraps existing Agent |
299
+ | **AutoGen** | "I want agents talking" | `GroupChat` with speaker selection, message history | `Conversation` class: round-robin/auto speaker order, shared message history | βœ… Each turn is an `Agent.run()` |
300
+ | **OpenAI Agents SDK** | "I want plug-and-play" | `Agent(name, instructions, tools)` β†’ `Runner.run(task)` | `Agent` factory: auto-resolves model strings, auto-creates environment, one-liner | βœ… Wraps Orchestrator |
301
+ | **LlamaIndex** | "I want knowledge" | `QueryEngineTool` β€” RAG as an agent tool | `KnowledgeStore.as_tool()` β€” chunk/embed/retrieve as a Tool | βœ… Plugs into ToolRegistry |
302
+
303
+ ### Research Behind Each
304
+
305
+ **Graph Execution (LangGraph pattern)**
306
+ - LangGraph uses a `StateGraph` where nodes are functions that transform state, edges are routing rules
307
+ - Conditional edges enable cycles (retry loops) and branching (if/else in workflows)
308
+ - Our implementation: nodes are either `Agent` instances or `Callable[[State], State]` β€” when a node is an Agent, its entire Ξ¦ improvement loop runs automatically inside the graph node
309
+ - Key difference: LangGraph graphs are static compute graphs. Ours are self-improving β€” each node execution feeds experience replay
310
+
311
+ **Parallel Execution (CrewAI pattern)**
312
+ - CrewAI's `kickoff_for_each_async` is actually `loop.run_in_executor()` β€” not true async (documented caveat from CrewAI source)
313
+ - Our `parallel()` uses `ThreadPoolExecutor` directly β€” honest concurrency, no fake async wrapper
314
+ - All parallel tasks share the same experience replay via the Agent's Orchestrator β€” learning happens even during concurrent execution
315
+
316
+ **Agent Conversation (AutoGen GroupChat pattern)**
317
+ - AutoGen's `GroupChat` maintains a message list, uses LLM or round-robin for speaker selection
318
+ - Our `Conversation` feeds each agent the full conversation history as its State, then the agent responds via its normal Ξ¦-scored run loop
319
+ - Key innovation: conversation turns ARE Ξ¦-scored task executions. The agent learns what good conversation contributions look like across runs.
320
+
321
+ **Plug-and-Play Factory (OpenAI Agents SDK pattern)**
322
+ - OpenAI's `Agent(name, instructions, tools)` β†’ `Runner.run(agent, task)` is the gold standard for simplicity
323
+ - Our `Agent` class auto-resolves model strings: `"qwen3:1.7b"` β†’ OllamaBackend, `"gpt-4o"` β†’ OpenAICompatibleBackend, `"Qwen/Qwen3-32B"` β†’ HFInferenceBackend
324
+ - `handoff_from=other_agent` transfers experience replay β€” the OpenAI SDK handoff pattern, but with learning transfer
325
+
326
+ **Knowledge-Aware Agents (LlamaIndex QueryEngineTool pattern)**
327
+ - LlamaIndex's key insight: RAG works better as a TOOL the agent chooses to use (agentic RAG) than as a fixed pipeline (traditional RAG)
328
+ - Ref: HyDE (arxiv:2212.10496) β€” agent formulates retrieval-optimized queries instead of using user query directly
329
+ - Our `KnowledgeStore.as_tool()` converts any document collection into a Tool β€” the agent decides WHEN to retrieve
330
+ - Uses the same trigram embedding as ExperienceReplay (swappable via EmbeddingBackend for production sentence-transformers)
331
+
332
+ ### Architecture Decision: Why One File
333
+
334
+ All 5 capabilities live in `unified.py` (~30KB) because:
335
+ 1. **Zero coupling to core**: None of these modify Orchestrator, Actor, PurposeFunction, or ExperienceReplay
336
+ 2. **Composable**: You can use Graph + KnowledgeStore + Conversation together β€” they're independent layers
337
+ 3. **The Ξ¦ loop runs everywhere**: Agent.run() is the primitive. Graph nodes call it. Parallel tasks call it. Conversation turns call it. Every execution feeds the self-improvement loop.
338
+ 4. **Removable**: Delete `unified.py` and everything else still works. It's a pure extension layer.
339
+
340
+ ---
341
+
342
  ## Future Research Directions
343
 
344
  ### Papers to Implement Next