AgenticDomiKnowS Overview
- AgenticDomiKnowS (ADS) is a neuro-symbolic system that converts high-level natural language descriptions into complete, executable DomiKnowS programs.
- It utilizes a modular, agentic workflow with stages such as retrieval, graph synthesis, and model declaration that integrate LLM-based agents, RAG, and human feedback.
- By separating syntax and semantic validation, ADS streamlines program synthesis, significantly reducing development time for experts and non-experts alike.
AgenticDomiKnowS (ADS) is a neuro-symbolic program synthesis system designed to generate complete, executable DomiKnowS programs from free-form natural language descriptions. Built directly atop the DomiKnowS Python framework, ADS aims to make declarative neuro-symbolic programming accessible to users regardless of their familiarity with DomiKnowS’s API, while supporting high-level symbolic reasoning and rapid program construction through a modular agentic workflow. ADS leverages multiple LLM-based agents, retrieval-augmented generation (RAG), and optional human-in-the-loop mechanisms to decompose program synthesis into interpretable, independently testable stages, resulting in significant efficiency gains for both expert and non-expert users (Nafar et al., 2 Jan 2026).
1. Foundations: The DomiKnowS Framework and Its Barriers
DomiKnowS is a Python library enabling declarative construction of conceptual graphs, where nodes represent concepts, edges denote relations, and higher-order logic specifies constraints over them. To operationalize neuro-symbolic (NeSy) learning, users attach neural or vision models ("sensors", "learners") to the graph, constraining their outputs to adhere to first-order logical rules, hierarchies, and other symbolic relations. Inference proceeds by solving the resulting constrained optimization problems, typically via integer linear programming (ILP).
Despite its expressive power, DomiKnowS requires direct authoring of each domain concept, relation, property, and logical constraint using a domain-specific Python DSL. The manual burden is substantial: experts must not only learn the API but encode logic at a low abstraction level. Prior attempts to reduce development time with LLMs as coding assistants still required substantial intervention and iterative debugging (Nafar et al., 2 Jan 2026).
2. Agentic Multi-Stage Workflow of ADS
ADS overcomes DomiKnowS’s accessibility barriers by translating high-level task descriptions into executable programs using a LangGraph-based workflow, structured into modular, agentic stages. Each stage has specialized agents responsible for one class of decision, supported by a global retrieval corpus of prior DomiKnowS programs.
Core Workflow Stages
| Stage | Primary Agents/Submodules | Function |
|---|---|---|
| Retrieval (RAG) | Rag Selector | In-context example retrieval from corpus based on user prompt |
| Knowledge Declaration | Graph Design, Graph Execution, Graph Reviewer, Human | Iterative graph, relations, and logic synthesis and validation |
| Model Declaration | Sensor Design, Sensor Human Coder, Property Designator | Sensor and learner assignment, property-field mapping, LLM prompt generation |
| Assembly/Export | Notebook Export | Full DomiKnowS program and notebook emission |
The process proceeds as follows:
- The Rag Selector retrieves up to five in-context example programs relevant to the input task.
- The Graph Design Agent synthesizes a draft graph (concepts, relations, first-order constraints) in the DomiKnowS DSL.
- The Graph Execution Agent runs the draft code in a sandbox, returning execution errors.
- The Graph Reviewer Agent, implemented via LLM, produces semantic feedback highlighting logical errors, omissions, or redundancies.
- Upon failures (detected by execution or semantic review), an automated bounded loop iterates graph synthesis with updated feedback until a threshold is reached; then, optionally, a human reviewer intervenes.
- The Model Declaration phase synthesizes and validates sensor attachments (e.g., ReaderSensor, LabelReaderSensor, ManyToManyReaderSensor), property-field mappings, and learning prompts.
- The final output is a structured Jupyter notebook assembling all code components, ready for execution.
This decomposition ensures isolated error correction for both syntactic and semantic issues, supporting automatic self-refinement and optional human interventions after bounded attempts (Nafar et al., 2 Jan 2026).
3. Formal Representations and Logic Encoding
ADS leverages DomiKnowS’s declarative constraint language to encode domain logic and symbolic constraints. Typical constraint elements include:
- Concept predicates: e.g.,
- Property predicates: e.g.,
- Logical operators:
- , ,
An example of a transitivity constraint for the WIQA dataset, represented in DomiKnowS, is:
1 2 3 4 5 6 7 8 |
ifL(
Trans(t1, t2, t3),
andL(
eq(Ans(t1), is_more),
eq(Ans(t2), is_more)
),
eq(Ans(t3), is_more)
) |
This encodes the first-order formula:
At inference time, DomiKnowS converts such constraints into integer linear constraints for solution by an ILP solver (Nafar et al., 2 Jan 2026).
4. Core Algorithmic Pattern
The central ADS synthesis loop (for Knowledge Declaration; Model Declaration is analogous) separates syntax and semantic validation, enabling robust refinement:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function GenerateKnowledgeDeclaration(taskDesc, RAG_corpus):
examples = RagSelector(taskDesc, RAG_corpus)
attempts = 0
maxAttempts = K
loop:
graphDraft = GraphDesignAgent(taskDesc, examples)
execErrors = GraphExecutionAgent(graphDraft)
reviewNotes = GraphReviewerAgent(graphDraft)
if execErrors.empty() and reviewNotes.approved():
return graphDraft
attempts += 1
if attempts >= maxAttempts:
humanFeedback = GraphHumanReviewer(graphDraft, execErrors, reviewNotes)
if humanFeedback.approved:
return graphDraft
else:
examples.append(humanFeedback)
attempts = 0
GraphDesignAgent.updateContext(execErrors, reviewNotes) |
This architecture isolates error modes (syntax vs. semantics), employs bounded automatic retries (cf. Madaan et al. 2023), and integrates human feedback as needed, achieving a balance between speed and revision flexibility (Nafar et al., 2 Jan 2026).
5. Empirical Evaluation and Worked Example
Worked Example: WIQA Transitivity
- Prompt: "We have paragraphs and three questions each. Labels are is_more/is_less/no_effect. If question 1 and question 2 both increase the quantity, then question 3 must also increase."
- Retrieval: Five prior related workflows (e.g., RuleTaker, BeliefBank).
- Graph synthesis: Concepts (Paragraph, Question), relation (Paragraph.contains(Question)), and a transitivity constraint as detailed above.
- Automatic and human feedback: Automated review suggests optional symmetric constraint; user accepts as-is.
- Sensor/model assignment: ReaderSensors for text, LabelReaderSensor for labels, LLMModel for inference.
- Property mapping: Automatic link of dataset fields (e.g., paragraph text and labels) to DomiKnowS entities.
- Export: Jupyter notebook generated for zero-shot or fine-tuning inference, respecting ILP-enforced consistency.
Efficiency Metrics
Empirical evaluation demonstrates dramatic time savings and high-quality synthesis:
- Knowledge Declaration (12 tasks × 3 seeds = 36 runs): GPT-5 (low-reasoning) correct for 61.11% (plus 25% semantically correct but redundant, 86.11% total before human), Kimi-k2 at 97.22% (high latency, not live).
- End-to-end Model Declaration (12 tasks × 5 runs = 60 runs): GPT-5 (medium), 82% success.
- Human study (3 tasks, 6 participants): DomiKnowS experts completed tasks in 10–20 minutes vs. hours by hand; non-experts solved 2 of 3 tasks in 10–15 minutes, the last with guidance in under 30 minutes.
- Manual DomiKnowS authoring: typically several hours per program (Nafar et al., 2 Jan 2026).
6. Limitations and Prospective Directions
ADS currently targets DomiKnowS and is tightly coupled to its API, conceptual graph abstractions, and symbolic constraint language. Extension to other NeSy libraries (e.g., DeepProbLog, Scallop, Pylon) would require automated component discovery in alternate APIs and development of new retrieval corpora. Dependence on high-reasoning LLMs can limit effectiveness in large-scale or unusual symbolic domains, and current RAG strategies may require augmentation with external ontologies for comprehensive coverage.
Handling domains with more complex logic (e.g., higher-order logics, dynamic rule generation) may exceed the scope of the current agent-review loop. Planned improvements include richer user interfaces for visual constraint editing, enhanced provenance tracking, deeper integration with debuggers, and generalization of the agentic pipeline to support zero-touch synthesis across diverse NeSy frameworks by programmatic interface discovery and RAG corpus construction (Nafar et al., 2 Jan 2026).
7. Significance and Implications
By modularizing neuro-symbolic program synthesis into coordinated agentic stages—retrieval, graph synthesis, automatic/semantic/self-refinement, and program assembly—ADS significantly reduces development time and lowers the technical barrier for declarative NeSy program design. Non-expert users can generate correct, executable DomiKnowS programs in minutes, while experts retain the option to intervene selectively at points of high domain complexity. This suggests a substantial shift in the accessibility and scalability of neuro-symbolic methods for complex, constraint-driven reasoning tasks.