Skip to content

Lang extract for experiments - #3

Open
Fraol-M wants to merge 3 commits into
BekLG:Langextract-experimentsfrom
Fraol-M:lang-extract-for-experiments
Open

Lang extract for experiments#3
Fraol-M wants to merge 3 commits into
BekLG:Langextract-experimentsfrom
Fraol-M:lang-extract-for-experiments

Conversation

@Fraol-M

@Fraol-M Fraol-M commented Jul 21, 2026

Copy link
Copy Markdown

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.py
    Adds 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.py
    Adds mention prepass support to detect names, entities, noun mentions, and pronouns before extraction.

  • PLN-RAG/core/discourse/lingmess_coreference.py
    Adds optional LingMess/FastCoref support for document-level coreference. This is hint-only and disabled by default.

  • PLN-RAG/core/evidence/ and PLN-RAG/storage/evidence_ledger.py
    Adds SQLite evidence-linked storage so accepted PLN claims are tied to exact source spans and lineage metadata.

  • PLN-RAG/storage/vector_store.py
    Updates 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.py and PLN-RAG/core/pln/predicate_mapping.py
    Adds conservative predicate registry and predicate mapping support. Semantic bridge generation remains disabled by default for proof safety.

  • PLN-RAG/core/reasoning/reasoner.py
    Runs 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant