Input:
text id="jlwm2l" Ravi lives in a sunny village in India. He has seven bright fish in a small pond. Every morning, Ravi feeds them rice. The seven fish swim fast and splash water. Ravi claps his hands and laughs. He loves his seven fish friends. They are all very happy and safe.
At this stage:
Break text into sentences.
```text id=“jlwm3m” S1: Ravi lives in a sunny village in India.
S2: He has seven bright fish in a small pond.
S3: Every morning, Ravi feeds them rice.
S4: The seven fish swim fast and splash water.
S5: Ravi claps his hands and laughs.
S6: He loves his seven fish friends.
S7: They are all very happy and safe.
Why?
Because reasoning becomes easier sentence-by-sentence.
---
# Step 3 — Tokenization
Split into words/tokens.
Example:
```text id="jlwm4n"
Ravi | lives | in | a | sunny | village | in | India
Another:
text id="jlwm5o" The | seven | fish | swim | fast
Now system can process units individually.
Find grammatical roles.
Example:
text id="jlwm6p" Ravi → proper noun lives → verb sunny → adjective village → noun India → proper noun
Another sentence:
text id="jlwm7q" fish → noun swim → verb fast → adverb
What happens here?
The system now knows:
Find important real-world entities.
Detected:
text id="jlwm8r" Ravi → PERSON India → COUNTRY
Possible additional semantic entities:
text id="jlwm9s" village → LOCATION pond → PLACE fish → ANIMAL
Now words become typed entities.
Resolve pronouns.
Example:
text id="’wini0t" He → Ravi them → fish They → fish
Without this:
text id="’wini1u" He them they
would remain disconnected fragments.
Now all references merge into same entities.
Find grammatical relationships.
Example:
Sentence:
text id="’wini2v" Ravi feeds them rice.
Parse:
text id="’wini3w" Ravi → subject → feeds feeds → object → fish feeds → instrument/food → rice
Another:
text id="’wini4x" fish → subject → swim fish → subject → splash
Now the system understands: WHO does WHAT.
Create nodes.
Entities found:
text id="’wini5y" Ravi Village India Fish Pond Rice Water Morning
Each becomes a graph node.
Extract descriptions/attributes.
From text:
text id="’wini6z" sunny village small pond bright fish happy fish safe fish
Properties:
```text id=“’wini7a” Village: weather = sunny
Pond: size = small
Fish: brightness = bright emotion = happy safety = safe count = 7
Now entities gain semantic metadata.
---
# Step 10 — Relation Extraction
Convert actions into graph edges.
---
## Sentence 1
```text id="’wini8b"
Ravi lives in village
Village in India
Relations:
text id="’wini9c" Ravi → lives_in → Village Village → located_in → India
text id="’wini0d" Ravi has fish Fish in pond
Relations:
text id="’wini1e" Ravi → owns → Fish Fish → located_in → Pond
text id="’wini2f" Ravi feeds fish rice
Relations:
text id="’wini3g" Ravi → feeds → Fish Ravi → feeds_with → Rice
text id="’wini4h" Fish swim Fish splash water
Relations:
text id="’wini5i" Fish → swims_in → Pond Fish → splashes → Water
text id="’wini6j" Ravi claps Ravi laughs
Relations:
text id="’wini7k" Ravi → performs → clap Ravi → performs → laugh
text id="’wini8l" Ravi loves fish
Relation:
text id="’wini9m" Ravi → loves → Fish
Now combine everything.
text id="’wini0n" Ravi Fish Village India Pond Rice Water Morning
```text id=“’wini1o” Ravi → lives_in → Village Village → located_in → India
Ravi → owns → Fish Fish → located_in → Pond
Ravi → feeds → Fish Ravi → feeds_with → Rice
Fish → swims_in → Pond Fish → splashes → Water
Ravi → loves → Fish
---
# Properties
```text id="’wini2p"
Fish:
count = 7
state = happy
state = safe
appearance = bright
Village:
weather = sunny
Pond:
size = small
Now meaning becomes structured.
Now the graph can reason.
Known:
text id="’wini3q" Fish → animal Animals → living
Infer:
text id="’wini4r" Fish → living
Known:
text id="’wini5s" Ravi feeds fish Ravi loves fish
Infer:
text id="’wini6t" Ravi → cares_for → Fish
Known:
text id="’wini7u" Fish swim
Infer:
text id="’wini8v" Fish → movable
Now the system can summarize meaning.
Example abstract understanding:
text id="’wini9w" Ravi is a caring person who lives in India and takes care of seven fish.
This meaning never appeared literally. It was inferred.
Now questions become easy.
text id="’wini0x" Who feeds the fish?
Graph lookup:
text id="’wini1y" Ravi → feeds → Fish
Answer:
text id="’wini2z" Ravi
text id="մբույն3a" Where do fish live?
Lookup:
text id="մբույն4b" Fish → located_in → Pond
Answer:
text id="մբույն5c" pond
Raw text became:
text id="մբույն6d" entities + properties + relations + inferred knowledge + queryable memory
That is the foundation of: