Production-grade RAG framework with Arabic NLP support — chunking, embeddings, LLM interfaces, vector databases, routing, and more.
Project description
fennec-community
Production-grade RAG framework with Arabic NLP support
fennec-community is a modular Python library for building Retrieval-Augmented Generation (RAG) pipelines. It ships with first-class support for Arabic text and integrates with all major LLM providers, embedding models, and vector databases.
Features
- Smart Chunking — Semantic, adaptive, structure-aware, context-aware, and Arabic-specific chunkers
- Embeddings — OpenAI, Gemini, Mistral, Ollama, HuggingFace, and a dedicated Arabic embedder
- LLM Interfaces — Unified API over OpenAI, Anthropic, Gemini, Mistral, Groq, and Ollama
- Vector Databases — FAISS, ChromaDB, and Pinecone
- RAG Variants — Standard, Agentic, Conversational, Graph, Hybrid, Multi-Doc, Multi-Hop, Streaming, Domain-Specific, Self-Improving
- Prompt Engine — Dynamic context-aware prompt building with strategy support
- Router — Hierarchical semantic routing with caching, feedback, and observability
- Plugin System — Extensible plugin architecture with security controls
- Output Parsers — JSON, YAML, CSV, Pydantic, structured output with auto-fix and retry
- Document Loaders — PDF, DOCX, HTML, CSV, JSON, plain text, web, and directory loaders
Installation
pip install fennec-community
Install with optional extras for your provider of choice:
pip install fennec-community[openai] # OpenAI LLM + embeddings
pip install fennec-community[anthropic] # Anthropic Claude
pip install fennec-community[gemini] # Google Gemini
pip install fennec-community[ollama] # Local Ollama models
pip install fennec-community[faiss] # FAISS vector store
pip install fennec-community[chroma] # ChromaDB vector store
pip install fennec-community[pinecone] # Pinecone vector store
pip install fennec-community[arabic] # Arabic NLP tools
pip install fennec-community[all] # Everything
Quick Start
Basic RAG Pipeline
from fennec_community.rag.core import RAGSystem, RAGConfig
from fennec_community.embeddings import OpenAIEmbedder
from fennec_community.vector_database import FAISSVectorDatabase
config = RAGConfig(top_k=5)
embedder = OpenAIEmbedder(api_key="sk-...")
db = FAISSVectorDatabase(embedder=embedder)
rag = RAGSystem(config=config, vector_db=db)
rag.load_documents(["path/to/docs/"])
answer = rag.query("What is the capital of France?")
print(answer)
Arabic Chunking
from fennec_community.chunks import ArabicTextChunker, ChunkConfig
chunker = ArabicTextChunker(config=ChunkConfig(chunk_size=512))
chunks = chunker.chunk("النص العربي هنا...")
for chunk in chunks:
print(chunk.text)
Conversational RAG
from fennec_community.rag.types.conversational_rag import ConversationalRAG
crag = ConversationalRAG(rag_system=rag)
response = crag.chat("Tell me about the report.")
response2 = crag.chat("Can you summarize the key points?")
Semantic Router
from fennec_community.router import HierarchicalRouter, Route, RouteGroup
router = HierarchicalRouter()
router.add_group(
RouteGroup(
name="support",
routes=[
Route(name="billing", keywords=["invoice", "payment", "refund"]),
Route(name="technical", keywords=["error", "bug", "crash"]),
]
)
)
result = router.route("I need help with my invoice")
print(result.matched_route) # "billing"
LLM Interface
from fennec_community.llm import OpenAIInterface
llm = OpenAIInterface(api_key="sk-...")
response = llm.chat("Explain RAG in one sentence.")
print(response)
Output Parsing
from fennec_community.output_parser import OutputParser
parser = OutputParser()
result = parser.parse('{"name": "Alice", "age": 30}', format="json")
print(result) # {'name': 'Alice', 'age': 30}
Modules
| Module | Description |
|---|---|
fennec_community.chunks |
Text chunking strategies including Arabic support |
fennec_community.embeddings |
Embedding models for multiple providers |
fennec_community.llm |
LLM provider interfaces |
fennec_community.vector_database |
Vector store backends (FAISS, Chroma, Pinecone) |
fennec_community.rag |
Full RAG system with multiple retrieval strategies |
fennec_community.prompt |
Prompt engineering and context management |
fennec_community.router |
Semantic routing with hierarchical matching |
fennec_community.context |
Context window management and retrieval |
fennec_community.output_parser |
Structured output parsing and validation |
fennec_community.document_loaders |
Document ingestion from various sources |
fennec_community.plugins |
Plugin system for extending functionality |
fennec_community.chain |
Sequential, parallel, and conditional chains |
RAG Variants
| Variant | Class | Use Case |
|---|---|---|
| Standard RAG | RAGSystem |
General question answering |
| Agentic RAG | AgenticRAG |
Multi-step reasoning with tool use |
| Conversational RAG | ConversationalRAG |
Multi-turn chat with memory |
| Graph RAG | GraphRAG |
Knowledge graph-based retrieval |
| Hybrid Search RAG | HybridSearchRAG |
Dense + sparse retrieval |
| Multi-Doc RAG | MultiDocRAG |
Cross-document reasoning |
| Multi-Hop RAG | MultiHopRAG |
Complex multi-step queries |
| Streaming RAG | StreamingRAG |
Token-by-token streaming responses |
| Domain RAG | DomainSpecificRAG |
Domain-constrained retrieval |
| Self-Improving RAG | SelfImprovingRAG |
Iterative refinement with HyDE |
| Federated RAG | FederatedRAG |
Multi-source distributed retrieval |
Requirements
- Python >= 3.9
- pydantic >= 2.0
- numpy >= 1.24
- tiktoken >= 0.5
All other dependencies are optional and installed via extras.
License
MIT License — see LICENSE for details.
Contributing
Contributions are welcome! Please open an issue or pull request on GitHub.
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 fennec_community-0.1.0.tar.gz.
File metadata
- Download URL: fennec_community-0.1.0.tar.gz
- Upload date:
- Size: 439.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c63b73115cd323092eda44ec6a008efffe2ff592be6afdda95e5fb30bbaf4732
|
|
| MD5 |
467111f0937e42ffefac43e6f93dbdf2
|
|
| BLAKE2b-256 |
fb37556c3f36e73384b72342bd212a22fbf27be75a54893c950c41c4ebd75e74
|
File details
Details for the file fennec_community-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fennec_community-0.1.0-py3-none-any.whl
- Upload date:
- Size: 540.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf73e3e825262f0f151e0b07f652765e08aa544c807304cf4f9b06c054fb0ed
|
|
| MD5 |
c6770c344c816ffe0bcb787a58139118
|
|
| BLAKE2b-256 |
25fa996819b95f9000c6d6367a10eac056f1a4ecb48f4d87b47caa8c03495a8e
|