Architectures¶
Every public architecture class — auto-generated from docstrings.
Foundational patterns¶
Reflection ¶
Bases: Architecture
Self-Refine style reflection loop.
Source code in src/agentic_architectures/architectures/reflection.py
ToolUse ¶
ToolUse(tools: list[Any] | None = None, max_rounds: int = 6, system_prompt: str | None = None, **kwargs: Any)
Bases: Architecture
Tool-calling loop. The agent decides when to use a tool and when to stop.
Source code in src/agentic_architectures/architectures/tool_use.py
ReAct ¶
ReAct(tools: list[Any] | None = None, max_rounds: int = 5, system_prompt: str | None = None, **kwargs: Any)
Bases: Architecture
Explicit two-node ReAct loop: think → act → (tools → think)* → END.
Source code in src/agentic_architectures/architectures/react.py
Planning ¶
Planning(tools: list[Any] | None = None, max_replans: int = 2, executor_rounds: int = 3, **kwargs: Any)
Bases: Architecture
Plan-Execute-Replan loop.
Source code in src/agentic_architectures/architectures/planning.py
MultiAgent ¶
MultiAgent(specialists: dict[str, str] | None = None, tools: list[Any] | None = None, specialist_rounds: int = 3, **kwargs: Any)
Bases: Architecture
Supervisor + N specialists + Writer.
Source code in src/agentic_architectures/architectures/multi_agent.py
PEV ¶
PEV(tools: list[Any] | None = None, max_retries_per_step: int = 2, executor_rounds: int = 4, **kwargs: Any)
Bases: Architecture
Plan-Execute-Verify with per-step retry-with-critique.
Source code in src/agentic_architectures/architectures/pev.py
Blackboard ¶
Blackboard(knowledge_sources: dict[str, str] | None = None, max_rounds: int = 6, min_confidence: int = 3, **kwargs: Any)
Bases: Architecture
Distributed multi-agent system with opportunistic, bid-driven contribution.
Source code in src/agentic_architectures/architectures/blackboard.py
EpisodicSemanticAgent ¶
EpisodicSemanticAgent(episodic: EpisodicMemory | None = None, semantic: SemanticMemory | None = None, recall_k_episodes: int = 3, recall_facts_depth: int = 1, **kwargs: Any)
Bases: Architecture
Dual-memory agent: FAISS episodes + NetworkX/Neo4j facts; persistent across run() calls.
Source code in src/agentic_architectures/architectures/episodic_semantic.py
TreeOfThoughts ¶
Bases: Architecture
Beam-search over a tree of LLM-generated reasoning steps.
Source code in src/agentic_architectures/architectures/tree_of_thoughts.py
MentalLoop ¶
Bases: Architecture
Generate → simulate → score → pick best → explain.
Create a Mental Loop architecture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_candidates
|
int
|
how many candidate actions to generate. |
3
|
scoring_fn
|
Callable[[float], int] | None
|
optional deterministic Python function that takes the
LLM's |
None
|
Source code in src/agentic_architectures/architectures/mental_loop.py
MetaController ¶
Bases: Architecture
LLM router that picks the right architecture per task.
Source code in src/agentic_architectures/architectures/meta_controller.py
GraphMemoryAgent ¶
Bases: Architecture
Knowledge-graph world model + traversal-based Q&A.
Source code in src/agentic_architectures/architectures/graph_memory.py
ingest ¶
Extract triples from text and add them to the graph.
Source code in src/agentic_architectures/architectures/graph_memory.py
run ¶
Answer a question by traversing the current graph.
Source code in src/agentic_architectures/architectures/graph_memory.py
Ensemble ¶
Ensemble(voters: dict[str, str] | None = None, aggregator_mode: Literal['llm_synth', 'majority_vote', 'highest_confidence'] = 'llm_synth', **kwargs: Any)
Bases: Architecture
N voters with diverse prompts run on the same task; aggregator combines.
Source code in src/agentic_architectures/architectures/ensemble.py
DryRun ¶
DryRun(irreversibility_threshold: int = 4, require_human_approval_above_severity: Literal['low', 'medium', 'high'] | None = 'high', **kwargs: Any)
Bases: Architecture
Propose → simulate → approve → execute-or-skip safety pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
irreversibility_threshold
|
int
|
Python hard-cap. Any predicted irreversibility
|
4
|
require_human_approval_above_severity
|
Literal['low', 'medium', 'high'] | None
|
Severity levels at or above this require human-in-the-loop in production (in this demo, marked but auto-mocked). |
'high'
|
Source code in src/agentic_architectures/architectures/dry_run.py
RLHFSelfImprovement ¶
RLHFSelfImprovement(max_iterations: int = 2, target_score: int = 8, word_count_range: tuple[int, int] = (30, 100), **kwargs: Any)
Bases: Architecture
Generate → critique → revise → maybe archive; archive persists across runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_iterations
|
int
|
max refinement rounds per task. |
2
|
target_score
|
int
|
minimum COMPOSITE Python-score (0-10) for archive acceptance. |
8
|
word_count_range
|
tuple[int, int]
|
(min, max) word count to receive the word-count points. |
(30, 100)
|
Source code in src/agentic_architectures/architectures/rlhf.py
CellularAutomata ¶
CellularAutomata(rule_prompt: str, allowed_states: list[str], height: int = 4, width: int = 4, max_steps: int = 3, **kwargs: Any)
Bases: Architecture
Grid of cells, each updated by an LLM per step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rule_prompt
|
str
|
A short description of the LOCAL update rule the LLM should follow. |
required |
allowed_states
|
list[str]
|
List of valid state labels each cell can hold (e.g. ['fire', 'tree', 'empty']). |
required |
height, width
|
Grid dimensions. Default 4x4 = 16 cells; cap aggressively. |
required | |
max_steps
|
int
|
How many time steps to simulate. |
3
|
Source code in src/agentic_architectures/architectures/cellular_automata.py
run ¶
Run the simulation. task is the INITIAL GRID as a multi-line string,
with cells separated by | and rows by \n.
Example: 'tree|tree|fire|empty\ntree|tree|tree|empty'
Source code in src/agentic_architectures/architectures/cellular_automata.py
ReflexiveMetacognitive ¶
Bases: Architecture
Self-aware agent that picks one of four routes per task.
Source code in src/agentic_architectures/architectures/reflexive_metacognitive.py
Advanced patterns¶
Reflexion ¶
Reflexion(max_trials: int = 3, reflections_to_recall: int = 3, evaluator: Callable[[str, str], dict[str, Any]] | None = None, reflection_llm: BaseChatModel | None = None, episodic: EpisodicMemory | None = None, **kwargs: Any)
Bases: Architecture
Try → evaluate → verbal self-reflection → store → retry, with memory
that persists across :meth:run calls on the same instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_trials
|
int
|
hard cap on attempt → evaluate iterations per task. |
3
|
reflections_to_recall
|
int
|
top-k past reflections to prepend on each new attempt's prompt. |
3
|
evaluator
|
Callable[[str, str], dict[str, Any]] | None
|
|
None
|
reflection_llm
|
BaseChatModel | None
|
optionally use a stronger model for the reflection step (defaults to the same LLM as the agent). |
None
|
episodic
|
EpisodicMemory | None
|
optionally inject a pre-existing :class: |
None
|
Source code in src/agentic_architectures/architectures/reflexion.py
SelfDiscover ¶
Bases: Architecture
SELECT → ADAPT → IMPLEMENT → SOLVE — agent composes its reasoning recipe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
modules
|
list[str] | None
|
optional custom module library (replaces the default 16). |
None
|
Source code in src/agentic_architectures/architectures/self_discover.py
ChainOfVerification ¶
Bases: Architecture
BASELINE → PLAN questions → EXECUTE answers → REVISE.
Source code in src/agentic_architectures/architectures/chain_of_verification.py
SelfConsistency ¶
Bases: Architecture
Sample N CoT paths, majority-vote the modal final answer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
how many independent reasoning paths to draw. |
5
|
sample_temperature
|
float
|
temperature for the sampling LLM. Higher = more diverse paths (and more likely to surface the correct one via majority). |
0.8
|
Source code in src/agentic_architectures/architectures/self_consistency.py
LATS ¶
LATS(max_iterations: int = 6, branching: int = 3, ucb_c: float = 1.4, max_depth: int = 5, **kwargs: Any)
Bases: Architecture
MCTS-style tree search over LLM-generated thoughts with deterministic-picker reward.
Source code in src/agentic_architectures/architectures/lats.py
AgenticRAG ¶
AgenticRAG(documents: list[str] | None = None, vector_memory: VectorMemory | None = None, max_iterations: int = 4, top_k: int = 3, **kwargs: Any)
Bases: Architecture
ReAct-style agent with a single retrieve-tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
list[str] | None
|
optional list of source documents to seed the corpus. |
None
|
vector_memory
|
VectorMemory | None
|
a pre-built VectorMemory; takes precedence over |
None
|
max_iterations
|
int
|
hard cap on decide → retrieve cycles. |
4
|
top_k
|
int
|
number of documents to return per retrieve call. |
3
|
Source code in src/agentic_architectures/architectures/agentic_rag.py
CorrectiveRAG ¶
CorrectiveRAG(documents: list[str] | None = None, vector_memory: VectorMemory | None = None, web_search_fn: Callable[[str], list[str]] | None = None, top_k: int = 3, relevance_threshold: float = 0.5, **kwargs: Any)
Bases: Architecture
Retrieve → grade per-doc → route → answer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
documents
|
list[str] | None
|
optional list to seed a fresh VectorMemory. |
None
|
vector_memory
|
VectorMemory | None
|
pre-built memory; takes precedence over |
None
|
web_search_fn
|
Callable[[str], list[str]] | None
|
callable |
None
|
top_k
|
int
|
how many docs to retrieve. |
3
|
relevance_threshold
|
float
|
fraction of docs that must be 'relevant' to route directly to use_retrieved (else fall back / mix). |
0.5
|
Source code in src/agentic_architectures/architectures/corrective_rag.py
SelfRAG ¶
SelfRAG(documents: list[str] | None = None, vector_memory: VectorMemory | None = None, top_k: int = 4, **kwargs: Any)
Bases: Architecture
Retrieve → reflection tokens per doc → Python keeps usable docs → answer.
Source code in src/agentic_architectures/architectures/self_rag.py
AdaptiveRAG ¶
AdaptiveRAG(documents: list[str] | None = None, vector_memory: VectorMemory | None = None, top_k: int = 3, multi_step_max_iterations: int = 3, **kwargs: Any)
Bases: Architecture
Pre-route by complexity → execute the matched RAG strategy.
Source code in src/agentic_architectures/architectures/adaptive_rag.py
GraphRAG ¶
GraphRAG(documents: list[str] | None = None, semantic_memory: SemanticMemory | None = None, max_communities: int = 6, **kwargs: Any)
Bases: Architecture
Build knowledge graph + community summaries; route queries local vs global.
Source code in src/agentic_architectures/architectures/graph_rag.py
Debate ¶
Debate(n_agents: int = 3, n_rounds: int = 2, agent_personas: list[str] | None = None, sample_temperature: float = 0.7, **kwargs: Any)
Bases: Architecture
N agents × K rounds debate → majority vote on final answers.
Source code in src/agentic_architectures/architectures/debate.py
Voyager ¶
Bases: Architecture
Persistent skill library — retrieve, reuse, or write new skills.
Source code in src/agentic_architectures/architectures/voyager.py
STORM ¶
STORM(n_perspectives: int = 3, questions_per_perspective: int = 2, web_search_fn: Callable[[str], list[str]] | None = None, **kwargs: Any)
Bases: Architecture
Multi-perspective research → outline → article.
Source code in src/agentic_architectures/architectures/storm.py
MemGPT ¶
MemGPT(context_limit: int = 4, max_iterations: int = 5, archival: VectorMemory | None = None, **kwargs: Any)
Bases: Architecture
OS-style tiered memory: context (RAM) + archival (disk).
Source code in src/agentic_architectures/architectures/memgpt.py
ConstitutionalAI ¶
Bases: Architecture
Generate → critique against constitution → revise → loop until all pass.
Source code in src/agentic_architectures/architectures/constitutional_ai.py
SWEAgent ¶
Bases: Architecture
Code-repo agent with sandboxed FS tools (list / read / write / run / answer).
Source code in src/agentic_architectures/architectures/swe_agent.py
ComputerUse ¶
ComputerUse(initial_screen: dict[str, Any] | None = None, sensitive_patterns: list[str] | None = None, blocked_domains: list[str] | None = None, max_iterations: int = 6, **kwargs: Any)
Bases: Architecture
Mock-environment Computer-Use agent with hard safety gate.
Source code in src/agentic_architectures/architectures/computer_use.py
BrowserAgent ¶
BrowserAgent(max_iterations: int = 6, headless: bool = True, page_text_chars: int = 2500, sensitive_patterns: list[str] | None = None, blocked_domains: list[str] | None = None, **kwargs: Any)
Bases: Architecture
Real headless-Chromium agent via Playwright, with Python safety gate.
Source code in src/agentic_architectures/architectures/browser_agent.py
close ¶
Shut down the Playwright browser. Always call after run() is done.
Source code in src/agentic_architectures/architectures/browser_agent.py
AgentWorkflowMemory ¶
Bases: Architecture
Retrieve workflow → use as prior → answer → extract new workflow.