[EPIC] Prolog-first deep recursive autonomous research with LLM fallback only #423
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#423
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mission
Build a Prolog-first autonomous research engine inside
prolog-rlmthat can investigate open-ended questions deeply and recursively without requiring an LLM for planning, search, reasoning, evidence evaluation, or control flow.LLMs are optional fallback components, not the intelligence substrate.
Primary target:
An LLM may be used when useful for:
An LLM must not be required to decide what to research next, what sources to inspect, whether evidence supports a claim, whether a contradiction exists, whether more research is needed, or when a research branch is complete.
Core principle
The system should be as capable as practical using ordinary computation, symbolic AI, search, graph algorithms, expert rules, statistical/heuristic ranking, and external information sources.
A machine with SWI-Prolog, configured research adapters, and network/data access should still be able to perform a useful autonomous research run.
Relationship to existing runtime
Reuse current canonical runtime boundaries rather than creating a second agent runtime.
Relevant existing work includes:
symbolic,symbolic-recursive,auto);This epic is not permission to add another scheduler, another tool runtime, another authority system, or a model-controlled research loop parallel to the existing runtime.
Desired experience
A user should be able to ask:
The runtime should be able to proceed roughly as:
The exact predicates may differ. The semantic boundary matters.
1. Research state is symbolic data
Represent research as ordinary inspectable Prolog data with stable identities.
Conceptual minimum:
Do not flatten the research process into chat history or an opaque model transcript.
The complete current research state must be inspectable/queryable without asking a model to reconstruct it.
2. Deterministic natural-language front door
Natural language should be usable without forcing every utterance through an LLM.
Build a bounded deterministic normalization layer using appropriate Prolog-native techniques such as:
Example:
may normalize to data equivalent to:
If deterministic parsing cannot produce one defensible interpretation, return an inspectable ambiguity/unknown outcome.
Only then may conversation mode optionally invoke an LLM parser or ask the operator for clarification.
Model-generated Prolog must never be blindly
consulted or executed as trusted code.3. Deep recursive research planner
Implement a non-LLM research planner over symbolic goals.
It should support recursive decomposition from reusable expert rules such as:
Research strategies should be registered/extensible Prolog rules, not hard-coded into a model prompt.
The planner may use classical search/AI techniques where appropriate:
Use the existing graph/plan/async infrastructure where semantics align.
4. Autonomous research agenda
Each run maintains a bounded agenda/frontier of unresolved work.
Conceptual states:
The engine chooses the next branch from symbolic state and deterministic/heuristic scoring.
Priority should account for factors such as:
No model call should be necessary to maintain or select the agenda.
5. Research-tool abstraction
Research sources are normal runtime tools/adapters.
Potential adapters include:
The research engine reasons over a generic source/evidence contract rather than being coupled to one search provider.
Availability is not authority. Existing capability/authority/network/effect boundaries remain canonical.
6. Query generation without an LLM
Research must be able to generate useful searches from symbolic goals deterministically.
Support query construction from:
Example:
Use configurable synonym/alias/ontology knowledge to broaden or specialize queries.
The engine should be able to recursively learn in-run vocabulary from acquired sources without permanently trusting it as host code.
7. Evidence normalization and provenance
Every material claim needs evidence lineage.
Preserve at minimum:
Separate:
A derived Prolog conclusion must not masquerade as a directly observed fact.
8. Claim graph / knowledge graph
Maintain an explicit graph connecting:
Support traversal such as:
Recursive research should operate over this graph rather than repeatedly rereading an ever-growing prose context.
9. Contradiction and uncertainty handling
Do not collapse absence of evidence into falsehood.
Research outcomes must distinguish at least:
When sources conflict, preserve both branches and investigate the conflict.
Useful recursive follow-up strategies include:
10. Source quality / corroboration
Implement configurable non-LLM scoring/rules for evidence quality.
Possible inputs:
Do not turn a numeric score into fake certainty. Preserve the underlying evidence and reasons.
11. Recursive gap discovery
After each evidence update, derive what remains unknown.
Examples:
This is the heart of autonomous research: the next questions are generated from the current symbolic knowledge state.
12. Convergence and stop conditions
The engine needs explicit rules for knowing when to stop.
Stop/reduce expansion based on combinations of:
A run must never recurse forever merely because more web pages exist.
Return the stop reason.
13. Learning without an LLM
Support safe accumulation of useful knowledge from successful research runs.
Distinguish:
Do not auto-promote arbitrary web text into trusted executable Prolog.
Useful non-LLM adaptation may include:
Persistence must retain provenance and generation/version semantics.
14. Optional LLM fallback contract
The fallback boundary must be explicit and observable.
Conceptual API:
Default autonomous research policy should be equivalent to:
Every fallback event must be traceable with reason and usage.
A model response is evidence only when the operator explicitly configures a model itself as a source; otherwise model output is never treated as factual evidence.
15. Conversation mode
Conversation is a projection over the symbolic state, not the state itself.
Preferred flow:
The LLM renderer receives bounded structured facts/proofs/evidence and may improve phrasing, but must not silently add unsupported factual claims.
The user should be able to ask conversationally:
Those utterances should map onto operations over the existing research graph.
16. Explainability
A completed run should be able to expose:
A useful answer should never require replaying an opaque hidden reasoning transcript.
17. Determinism and replay
Given a fixed corpus/tool-result fixture, config, strategy registry, and budgets, the symbolic research controller should be reproducible enough for deterministic tests.
Persist stable event/decision records sufficient to explain:
Live network results may naturally vary; control-flow semantics must still be testable with fixtures.
18. Safety / authority invariants
consultretrieved Prolog/source text.Proposed implementation slices
S1 — Research state + claim/evidence graph
Add generic symbolic research-run, goal, claim, evidence, source, gap, and provenance contracts.
S2 — Deterministic research agenda
Add frontier selection, dependency handling, budgets, progress/novelty accounting, and stop reasons.
S3 — Research strategy registry
Add extensible Prolog rule packs for decomposition/evidence requirements and strategy selection.
S4 — Generic search/fetch evidence adapters
Compose existing tool/MCP surfaces into a generic research-source contract.
S5 — Deterministic query compiler
Symbolic goal -> search/query candidates using aliases, ontology/lexicon, dates, source classes, and previous observations.
S6 — Evidence normalization + contradiction engine
Normalize observations, track provenance, derive support/conflict/mixed/unknown states, and generate evidence gaps.
S7 — Recursive gap-filling loop
Drive autonomous continuation entirely from research graph state.
S8 — Source quality + corroboration
Add configurable evidence-quality and independence rules.
S9 — Deterministic NL front door
DCG/template/entity/alias based intent + question normalization with explicit ambiguity.
S10 — Optional LLM fallback
Add strictly bounded fallback policy and trace events for parsing/rendering/optional summarization.
S11 — Conversation projection
Natural conversational inspection and continuation over the symbolic research state.
S12 — Durable learning / strategy metrics
Persist safe, provenance-carrying learned facts and research-strategy statistics without promoting untrusted executable code.
Child issues should be created as each slice reaches a concrete design boundary. Do not implement the entire epic as one PR.
Acceptance criteria
why, support, conflict, uncertainty, provenance, branch history, and stop reason are inspectable.North-star test
The strongest integration test should deliberately provide no LLM credentials/provider at all.
Fixture question requires multiple hops and conflicting evidence:
The run passes only if the runtime performs the complete recursive investigation and produces a structured evidence-backed conclusion with
model_calls = 0.Then run the same research session with conversation fallback enabled and prove that the optional model changes presentation only, not the underlying claim/evidence result.
Non-goals
End state
The intended architecture is:
Prolog owns the research intelligence.
The LLM is a useful language adapter when desired, not the thing keeping the system alive.
Closing as out of scope for
prolog-rlm. The request was intended for Zara, specifically its Prolog-first / natural-language autonomous research behavior. This issue was created in the wrong repository and should not be implemented here.