AI-powered knowledge management and retrieval system
Project description
VRIN Memory Orchestration
AI-powered knowledge management and retrieval system that provides human-like neural memory capabilities.
Quick Start
pip install vrin
from vrin import VRIN
# Create VRIN client with your API key
vrin = VRIN(api_key="your_api_key_here")
# Insert knowledge into memory
vrin.insert("Python is a programming language created by Guido van Rossum in 1991")
# Retrieve knowledge using natural language queries
results = vrin.query("What is Python?")
print(results)
That's it! VRIN automatically handles:
- ✅ Fact extraction and knowledge structuring
- ✅ Neural memory retrieval with semantic search
- ✅ Temporal context and conflict resolution
- ✅ Pronoun resolution for clarity
- ✅ User isolation and security
Features
🧠 Neural Memory System
- Human-like memory retrieval using semantic similarity
- Automatic fact extraction from natural language
- Temporal context awareness and conflict resolution
🔍 Intelligent Search
- Natural language querying
- Semantic similarity matching
- Context-aware responses
- Anti-hallucination protection
🛡️ Enterprise Security
- User isolation and data privacy
- API key management
- Secure authentication
- Rate limiting and monitoring
📊 Knowledge Graph Visualization
- Interactive graph visualization
- Real-time knowledge mapping
- Relationship discovery
- Temporal fact tracking
Installation
pip install vrin
Basic Usage
1. Initialize the Client
from vrin import VRIN
# Option 1: Pass API key directly
vrin = VRIN(api_key="your_api_key_here")
# Option 2: Use environment variable
import os
os.environ["VRIN_API_KEY"] = "your_api_key_here"
vrin = VRIN()
2. Insert Knowledge
# Insert single piece of knowledge
result = vrin.insert("Python is a high-level programming language created by Guido van Rossum")
# Insert multiple pieces of knowledge
texts = [
"Python was first released in 1991",
"Python is known for its simplicity and readability",
"Guido van Rossum is the creator of Python"
]
results = vrin.insert_multiple(texts)
3. Query Knowledge
# Basic query
results = vrin.query("What is Python?")
# Advanced query with LLM processing
results = vrin.query_advanced("Explain the history of Python programming language")
4. Access Knowledge Graph
# Get complete knowledge graph
graph = vrin.get_knowledge_graph()
nodes = graph['data']['nodes']
edges = graph['data']['edges']
API Reference
Core Methods
insert(text: str)
Insert knowledge into the system.
result = vrin.insert("Knowledge text here")
query(query: str)
Query knowledge using natural language.
results = vrin.query("What is the capital of France?")
get_knowledge_graph()
Retrieve the complete knowledge graph.
graph = vrin.get_knowledge_graph()
Advanced Methods
query_advanced(query: str)
Advanced query with LLM processing (may timeout for complex queries).
results = vrin.query_advanced("Complex query with reasoning")
insert_multiple(texts: List[str])
Insert multiple pieces of knowledge at once.
results = vrin.insert_multiple(["Text 1", "Text 2", "Text 3"])
query_multiple(queries: List[str])
Query multiple questions at once.
results = vrin.query_multiple(["Question 1", "Question 2"])
Error Handling
The SDK provides specific exception types for different error scenarios:
from vrin import VRINError, VRINAuthenticationError, VRINRateLimitError
try:
result = vrin.query("What is Python?")
except VRINAuthenticationError:
print("Invalid API key")
except VRINRateLimitError:
print("Rate limit exceeded")
except VRINError as e:
print(f"General error: {e}")
Configuration
Environment Variables
VRIN_API_KEY: Your VRIN API keyVRIN_BASE_URL: Custom API endpoint (optional)
Client Configuration
vrin = VRIN(
api_key="your_api_key",
base_url="https://custom-endpoint.com", # Optional
timeout=30, # Request timeout in seconds
max_retries=3 # Maximum retry attempts
)
Examples
Basic Knowledge Management
from vrin import VRIN
vrin = VRIN(api_key="your_api_key")
# Store knowledge about a topic
vrin.insert("Machine learning is a subset of artificial intelligence that enables computers to learn without being explicitly programmed.")
# Query the knowledge
results = vrin.query("What is machine learning?")
print(results)
Multi-step Knowledge Building
# Build knowledge incrementally
vrin.insert("John is a software engineer")
vrin.insert("John works at Google")
vrin.insert("Google is a technology company")
# Query complex relationships
results = vrin.query("Where does John work?")
print(results)
Knowledge Graph Analysis
# Get the complete knowledge graph
graph = vrin.get_knowledge_graph()
# Analyze the structure
nodes = graph['data']['nodes']
edges = graph['data']['edges']
print(f"Knowledge graph contains {len(nodes)} entities and {len(edges)} relationships")
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Email: contact@vrin.ai
- 📖 Documentation: https://docs.vrin.ai
- 🐛 Issues: https://github.com/vrin-ai/vrin-python/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vrin-0.1.0.tar.gz.
File metadata
- Download URL: vrin-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2959441f0672631ef1b43fe6dca385a81c3bf9c99e8fece7309390be4446f8fd
|
|
| MD5 |
de7552316aa44376985707c5475abecb
|
|
| BLAKE2b-256 |
f1303cc38cd58f726906289514e53becae821cfa3a65293b29788ec505d81726
|
File details
Details for the file vrin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vrin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b6997cc0b4baa72d9505f2d2191a1df30ae31c0daf1faac342d43f024de0876
|
|
| MD5 |
4e626f64ff2ec87661534279dd2e20d7
|
|
| BLAKE2b-256 |
ee24f7006a690aac3d6c66660ac6d678876f4e90ed2752537ca05b945dccd369
|