Lang extract for experiments - #3
Open
Fraol-M wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces an additional PLN generator based on the LangExtract library, with a proof-safe PLN-RAG pipeline for extraction, storage, retrieval, query planning, and reasoning.
Implementation Details
PLN-RAG/parsers/langextract_pln_parser.pyAdds the LangExtract parser entry point for extracting facts, rules, negations, types, and queries.
PLN-RAG/core/extraction/Handles LangExtract chunking, examples, and translation from LangExtract objects into PLN-style atoms.
PLN-RAG/core/discourse/mention_prepass.pyAdds mention prepass support to detect names, entities, noun mentions, and pronouns before extraction.
PLN-RAG/core/discourse/lingmess_coreference.pyAdds optional LingMess/FastCoref support for document-level coreference. This is hint-only and disabled by default.
PLN-RAG/core/evidence/andPLN-RAG/storage/evidence_ledger.pyAdds SQLite evidence-linked storage so accepted PLN claims are tied to exact source spans and lineage metadata.
PLN-RAG/storage/vector_store.pyUpdates Qdrant retrieval to store and retrieve accepted claim/query-target records instead of trusting raw chunk similarity.
PLN-RAG/core/query/Adds query planning and safety gates for intent, entity, predicate, arity, and polarity before sending a query to the reasoner.
PLN-RAG/core/pln/predicate_registry.pyandPLN-RAG/core/pln/predicate_mapping.pyAdds conservative predicate registry and predicate mapping support. Semantic bridge generation remains disabled by default for proof safety.
PLN-RAG/core/reasoning/reasoner.pyRuns proof search over selected PLN queries and checks positive vs explicit-negative proof status.
PLN-RAG/docs/Documents the architecture, coreference behavior, and proof-safe retrieval model.
Proof Safety Notes
Qdrant is used only for retrieval and candidate query alignment. It does not prove answers.
The final answer is produced only after the selected PLN query is checked by the reasoner. If the system cannot prove either the positive claim or explicit negation, it returns unknown instead of guessing.
Predicate mappings are stored as metadata by default and do not become proof rules unless explicitly enabled.