insert()
Insert text content into the knowledge base. Vrin chunks the text, extracts facts (entities + relationships), and indexes everything for retrieval.insert() waits for processing to complete. Pass wait=False to get a job ID and poll later.
Parameters
Text content to insert into the knowledge base.
Document title. Used in search results and source attribution.
Optional tags for categorization and filtering.
Optional metadata dict attached to the document.
If
True, poll until processing completes and return the result dict.
If False, return the job ID string immediately.Seconds between status polls when
wait=True.Maximum seconds to wait when
wait=True. Raises TimeoutError if exceeded.Synchronous (default)
Asynchronous
get_job_status()
Check the status of an async insertion job.Parameters
The job ID returned by
insert(wait=False).Returns
pending -> chunking -> extracting -> storing -> completed.
wait_for_job()
Poll a job until completion or timeout. Logs progress as the job moves through stages.Parameters
The job ID to wait on.
Seconds between status polls.
Maximum seconds to wait. Raises
TimeoutError if exceeded.Exceptions
JobFailedError— The job failed during processing.TimeoutError— The job did not complete withinmax_waitseconds. Useget_job_status()to check current state.
get_knowledge_graph()
Get knowledge graph visualization data showing entities and their relationships.Parameters
Maximum number of graph elements to return.
What happens during insertion
When you callinsert(), Vrin:
- Chunks the text into overlapping segments optimized for retrieval
- Extracts facts — entities, relationships, and attributes using an LLM
- Stores facts in the knowledge graph (Neptune) with
{model, timestamp, confidence}metadata - Indexes chunks in the vector store (OpenSearch) with BM25 + kNN embeddings
- Returns a summary with fact counts and chunk IDs